forked from TrueCloudLab/frostfs-http-gw
[#129] Fix race condition tests
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
c4521300ac
commit
acd8bbb34b
2 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,3 @@
|
|||
//go:build !race
|
||||
// +build !race
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue