[#184] *: Unify done contexts handling

If `ctx.Done()`, return `ctx.Err()` in every function that returns an error.

Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
Pavel Karpy 2023-03-28 17:58:28 +03:00 committed by Gitea
parent 221203beeb
commit 97e201993b
3 changed files with 4 additions and 4 deletions

View file

@ -88,7 +88,7 @@ func awaitNotaryDepositInClient(ctx context.Context, cli *client.Client, txHash
for i := 0; i < notaryDepositTimeout; i++ {
select {
case <-ctx.Done():
return nil
return ctx.Err()
default:
}

View file

@ -222,7 +222,7 @@ func (e *StorageEngine) processExpiredLocks(ctx context.Context, lockers []oid.A
select {
case <-ctx.Done():
e.log.Info("interrupt processing the expired locks by context")
e.log.Info("interrupt processing the expired locks", zap.Error(ctx.Err()))
return true
default:
return false
@ -236,7 +236,7 @@ func (e *StorageEngine) processDeletedLocks(ctx context.Context, lockers []oid.A
select {
case <-ctx.Done():
e.log.Info("interrupt processing the deleted locks by context")
e.log.Info("interrupt processing the deleted locks", zap.Error(ctx.Err()))
return true
default:
return false

View file

@ -340,7 +340,7 @@ func (c *Client) Wait(ctx context.Context, n uint32) error {
for {
select {
case <-ctx.Done():
return nil
return ctx.Err()
default:
}