Skip to content

Commit

Permalink
ignore not found error on remove operation
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <[email protected]>
  • Loading branch information
kobergj committed May 10, 2022
1 parent ecf81d9 commit 66b74d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/storage/utils/filelocks/filelocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ func ReleaseLock(lock *flock.Flock) error {

err = lock.Unlock()
if err == nil {
if !lock.Locked() {
if !lock.Locked() && !lock.RLocked() {
err = os.Remove(n)
if err != nil && os.IsNotExist(err) {
err = nil
}
}
}
releaseMutexedFlock(n)
Expand Down

0 comments on commit 66b74d7

Please sign in to comment.