diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /workhorse/internal/objectstore/multipart.go | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'workhorse/internal/objectstore/multipart.go')
-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 { |