Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,15 @@ func (r *layerStore) Load() error {
}
}

info, statErr := os.Stat(r.layerspath())
if statErr != nil && !os.IsNotExist(statErr) {
return statErr
}

if info != nil {
r.layerspathModified = info.ModTime()
}

return err
}

Expand Down Expand Up @@ -1924,7 +1933,6 @@ func (r *layerStore) Modified() (bool, error) {
}
if info != nil {
tmodified = info.ModTime() != r.layerspathModified
r.layerspathModified = info.ModTime()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the state of an object in a constant (by meaning) function is a bit strange. From my point of view, such functions should repeatedly return the same value. This was not the case before the fix.

}

return tmodified, nil
Expand Down