[#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:
parent
221203beeb
commit
97e201993b
3 changed files with 4 additions and 4 deletions
|
@ -88,7 +88,7 @@ func awaitNotaryDepositInClient(ctx context.Context, cli *client.Client, txHash
|
||||||
for i := 0; i < notaryDepositTimeout; i++ {
|
for i := 0; i < notaryDepositTimeout; i++ {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return nil
|
return ctx.Err()
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ func (e *StorageEngine) processExpiredLocks(ctx context.Context, lockers []oid.A
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
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
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
@ -236,7 +236,7 @@ func (e *StorageEngine) processDeletedLocks(ctx context.Context, lockers []oid.A
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
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
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -340,7 +340,7 @@ func (c *Client) Wait(ctx context.Context, n uint32) error {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return nil
|
return ctx.Err()
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue