Skip to content

Commit

Permalink
maintenace: ignore file not exist error in FileStore Off method
Browse files Browse the repository at this point in the history
  • Loading branch information
janos committed Feb 12, 2019
1 parent 4f85b2b commit 5dbe3a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion maintenance/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ func (s *FileStore) On() (changed bool, err error) {

// Off disables maintenance.
func (s *FileStore) Off() (changed bool, err error) {
if _, err = os.Stat(s.filename); os.IsNotExist(err) {
_, err = os.Stat(s.filename)
if os.IsNotExist(err) {
err = nil
return
}
if err != nil {
return
}
if err = os.Remove(s.filename); err != nil {
Expand Down

0 comments on commit 5dbe3a0

Please sign in to comment.