diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-09 12:10:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-09 12:10:27 +0000 |
commit | f4d6d3ec77286fa64810bd6a25c58671e0deedaf (patch) | |
tree | 7592fbcf6f7711c7729eabcc35935aade3f084eb /workhorse | |
parent | 82a546b14c7613fe355b3e68c425d5da8779641a (diff) | |
download | gitlab-ce-f4d6d3ec77286fa64810bd6a25c58671e0deedaf.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse')
-rw-r--r-- | workhorse/internal/objectstore/multipart.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/workhorse/internal/objectstore/multipart.go b/workhorse/internal/objectstore/multipart.go index fd1c0ed487d..4c5b64b27ee 100644 --- a/workhorse/internal/objectstore/multipart.go +++ b/workhorse/internal/objectstore/multipart.go @@ -11,7 +11,6 @@ import ( "net/http" "os" - "gitlab.com/gitlab-org/labkit/log" "gitlab.com/gitlab-org/labkit/mask" ) @@ -98,11 +97,11 @@ func (m *Multipart) readAndUploadOnePart(ctx context.Context, partURL string, pu if err != nil { return nil, fmt.Errorf("create temporary buffer file: %v", err) } - defer func(path string) { - if err := os.Remove(path); err != nil { - log.WithError(err).WithField("file", path).Warning("Unable to delete temporary file") - } - }(file.Name()) + defer file.Close() + + if err := os.Remove(file.Name()); err != nil { + return nil, err + } n, err := io.Copy(file, src) if err != nil { |