summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-11 21:05:34 +0100
committerGitHub <noreply@github.com>2020-08-11 21:05:34 +0100
commit74bd9691c685942798f2761607731697498ceeae (patch)
tree531d661263b839ccf8aa6af73bfb6710984f0dd9 /build
parentfaa676cc8b4419ac56fbf9d009ea8c6b79834024 (diff)
downloadgitea-74bd9691c685942798f2761607731697498ceeae.tar.gz
gitea-74bd9691c685942798f2761607731697498ceeae.zip
Re-attempt to delete temporary upload if the file is locked by another process (#12447)
Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'build')
-rw-r--r--build/generate-gitignores.go4
-rw-r--r--build/generate-licenses.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/build/generate-gitignores.go b/build/generate-gitignores.go
index 0f56ff3a89..f341c1ec48 100644
--- a/build/generate-gitignores.go
+++ b/build/generate-gitignores.go
@@ -15,6 +15,8 @@ import (
"path"
"path/filepath"
"strings"
+
+ "code.gitea.io/gitea/modules/util"
)
func main() {
@@ -33,7 +35,7 @@ func main() {
log.Fatalf("Failed to create temp file. %s", err)
}
- defer os.Remove(file.Name())
+ defer util.Remove(file.Name())
resp, err := http.Get(url)
diff --git a/build/generate-licenses.go b/build/generate-licenses.go
index 15db19e70a..53623e4193 100644
--- a/build/generate-licenses.go
+++ b/build/generate-licenses.go
@@ -15,6 +15,8 @@ import (
"path"
"path/filepath"
"strings"
+
+ "code.gitea.io/gitea/modules/util"
)
func main() {
@@ -33,7 +35,7 @@ func main() {
log.Fatalf("Failed to create temp file. %s", err)
}
- defer os.Remove(file.Name())
+ defer util.Remove(file.Name())
resp, err := http.Get(url)