Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
[#129] Fix race condition tests
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
  • Loading branch information
KirillovDenis authored and alexvanin committed Mar 11, 2022
1 parent c452130 commit acd8bbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions integration_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build !race
// +build !race

package main

import (
Expand Down
5 changes: 4 additions & 1 deletion uploader/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit acd8bbb

Please sign in to comment.