|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* MinIO Cloud Storage, (C) 2019 MinIO, Inc. |
|
|
|
* MinIO Cloud Storage, (C) 2019-2020 MinIO, Inc. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
@ -98,7 +98,12 @@ func (adm AdminClient) newRetryTimer(ctx context.Context, maxRetry int, unit tim |
|
|
|
defer close(attemptCh) |
|
|
|
defer close(attemptCh) |
|
|
|
for i := 0; i < maxRetry; i++ { |
|
|
|
for i := 0; i < maxRetry; i++ { |
|
|
|
// Attempts start from 1.
|
|
|
|
// Attempts start from 1.
|
|
|
|
attemptCh <- i + 1 |
|
|
|
select { |
|
|
|
|
|
|
|
case attemptCh <- i + 1: |
|
|
|
|
|
|
|
case <-ctx.Done(): |
|
|
|
|
|
|
|
// Stop the routine.
|
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
select { |
|
|
|
select { |
|
|
|
case <-time.After(exponentialBackoffWait(i)): |
|
|
|
case <-time.After(exponentialBackoffWait(i)): |
|
|
|