Default time before reporting failure: ~100 seconds.
| 23 | |
| 24 | // Default time before reporting failure: ~100 seconds. |
| 25 | struct RetryConfig { |
| 26 | RetryConfig(int64 init_delay_time_us = 100 * 1000, |
| 27 | int64 max_delay_time_us = 32 * 1000 * 1000, |
| 28 | int max_retries = 10) { |
| 29 | this->init_delay_time_us = init_delay_time_us; |
| 30 | this->max_delay_time_us = max_delay_time_us; |
| 31 | this->max_retries = max_retries; |
| 32 | } |
| 33 | |
| 34 | // In case of failure, every call will be retried max_retries times. |
| 35 | int max_retries; |
| 36 | |
| 37 | // Initial backoff time |
| 38 | int64 init_delay_time_us; |
| 39 | |
| 40 | // Maximum backoff time in microseconds. |
| 41 | int64 max_delay_time_us; |
| 42 | }; |
| 43 | |
| 44 | class RetryingUtils { |
| 45 | public: |
no outgoing calls