diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2018-05-29 01:17:53 +0300 |
---|---|---|
committer | Kim Carlbäcker <kim.carlbacker@gmail.com> | 2018-05-29 01:17:53 +0300 |
commit | 2c737278a6cfc23a6b74defc8647788a9182cf35 (patch) | |
tree | 45fe50a8c7d8178feba114e1f222abbfa9e204ab | |
parent | 307f8ab481eeae2ab2a3d69f9aeadbfabc1140d9 (diff) |
Ignore ENOENT when cleaning up lock files
-rw-r--r-- | changelogs/unreleased/cleanup-ignore-eexist.yml | 5 | ||||
-rw-r--r-- | internal/service/repository/cleanup.go | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/changelogs/unreleased/cleanup-ignore-eexist.yml b/changelogs/unreleased/cleanup-ignore-eexist.yml new file mode 100644 index 000000000..a17cabc50 --- /dev/null +++ b/changelogs/unreleased/cleanup-ignore-eexist.yml @@ -0,0 +1,5 @@ +--- +title: Ignore ENOENT when cleaning up lock files +merge_request: 740 +author: +type: fixed diff --git a/internal/service/repository/cleanup.go b/internal/service/repository/cleanup.go index c3e99daf2..f54a3dfb1 100644 --- a/internal/service/repository/cleanup.go +++ b/internal/service/repository/cleanup.go @@ -47,6 +47,11 @@ func cleanupRepo(repoPath string) error { func cleanRefsLocks(rootPath string, threshold time.Time) error { return filepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error { + if os.IsNotExist(err) { + // Race condition: somebody already deleted the file for us. Ignore this file. + return nil + } + if err != nil { return err } |