diff options
author | zeripath <art27@cantab.net> | 2021-07-16 19:22:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 19:22:44 +0200 |
commit | 0f11c5f592dd32db71beb5bbbf996f33a1c50f0d (patch) | |
tree | 399aa34aeae6ad94b12fea66cae52cabf649bad4 /modules | |
parent | Frontport v1.14.5 (#16453) (diff) | |
download | forgejo-0f11c5f592dd32db71beb5bbbf996f33a1c50f0d.tar.xz forgejo-0f11c5f592dd32db71beb5bbbf996f33a1c50f0d.zip |
Retry rename on lock induced failures (re-fix) (#16461) (#16462)
Backport #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) |