diff options
author | zeripath <art27@cantab.net> | 2021-07-16 18:16:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 19:16:04 +0200 |
commit | b08e14bbcf1b30c5266d89f6fdcc3a6cfa0324fa (patch) | |
tree | 5cb53e07b4f9472ef63cb85ff6f9fab46d35c279 /modules | |
parent | 6d8648ce061d404e12f37e2aa0a4c5bed86c330f (diff) | |
download | gitea-b08e14bbcf1b30c5266d89f6fdcc3a6cfa0324fa.tar.gz gitea-b08e14bbcf1b30c5266d89f6fdcc3a6cfa0324fa.zip |
Retry rename on lock induced failures (re-fix) (#16461)
Unfortunately #16435 asserts the wrong error and should use
os.LinkError not os.PathError.
Fix #16439
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/util/remove.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/util/remove.go b/modules/util/remove.go index 2310436525..754f3b7c11 100644 --- a/modules/util/remove.go +++ b/modules/util/remove.go @@ -64,7 +64,7 @@ func Rename(oldpath, newpath string) error { if err == nil { break } - unwrapped := err.(*os.PathError).Err + unwrapped := err.(*os.LinkError).Err if unwrapped == syscall.EBUSY || unwrapped == syscall.ENOTEMPTY || unwrapped == syscall.EPERM || unwrapped == syscall.EMFILE || unwrapped == syscall.ENFILE { // try again <-time.After(100 * time.Millisecond) |