diff --git a/integration_test.go b/integration_test.go index 3442116..8c124e4 100644 --- a/integration_test.go +++ b/integration_test.go @@ -1,6 +1,3 @@ -//go:build !race -// +build !race - package main import ( diff --git a/uploader/upload.go b/uploader/upload.go index c3ca85b..5fffa00 100644 --- a/uploader/upload.go +++ b/uploader/upload.go @@ -136,7 +136,10 @@ func (u *Uploader) Upload(c *fasthttp.RequestCtx) { obj.SetOwnerID(id) obj.SetAttributes(attributes...) - if idObj, err = u.pool.PutObject(c, *obj, file, pool.WithBearer(bt)); err != nil { + ctx, cancel := context.WithCancel(c) + defer cancel() + + if idObj, err = u.pool.PutObject(ctx, *obj, file, pool.WithBearer(bt)); err != nil { log.Error("could not store file in neofs", zap.Error(err)) response.Error(c, "could not store file in neofs", fasthttp.StatusBadRequest) return