Skip to content

Commit

Permalink
FileStore: ignore NotExist errors when writing
Browse files Browse the repository at this point in the history
in case generation directory has expired
  • Loading branch information
bford committed Apr 13, 2020
1 parent 62b8284 commit ced1f44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions go/model/qscod/fs/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ func (fs *FileStore) tryWriteRead(step Step, v Value) (Value, Head, error) {
}

// Try to write it to the versioned store -
// but don't fret if someone else wrote it first.
// but don't fret if someone else wrote it or if it has expired.
err = fs.state.WriteVersion(ver, string(buf))
if err != nil && !verst.IsExist(err) {
if err != nil && !verst.IsExist(err) && !verst.IsNotExist(err) {
return Value{}, Head{}, err
}

Expand Down
2 changes: 1 addition & 1 deletion go/model/qscod/fs/verst/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (st *State) refresh() error {
}

// Scan a directory for highest-numbered file or subdirectory matching format.
// If upTo > 0, then returns the highest-numbered version no higher than upTo.
// If upTo > 0, returns the highest-numbered version no higher than upTo.
func scan(path, format string, upTo Version) (
maxver Version, maxname string, names []string, err error) {

Expand Down

0 comments on commit ced1f44

Please sign in to comment.