[#129] Fix race condition tests

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-03-11 12:08:16 +03:00 committed by Alex Vanin
parent c4521300ac
commit acd8bbb34b
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,3 @@
//go:build !race
// +build !race
package main package main
import ( import (

View file

@ -136,7 +136,10 @@ func (u *Uploader) Upload(c *fasthttp.RequestCtx) {
obj.SetOwnerID(id) obj.SetOwnerID(id)
obj.SetAttributes(attributes...) 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)) log.Error("could not store file in neofs", zap.Error(err))
response.Error(c, "could not store file in neofs", fasthttp.StatusBadRequest) response.Error(c, "could not store file in neofs", fasthttp.StatusBadRequest)
return return