Skip to content

Commit 2939a2a

Browse files
authored
Adjust the jobs retry delays and number of attempts (#4169)
2 parents 20b863f + 79cef5e commit 2939a2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/tasks/src/new_queue.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,15 @@ const MAX_CONCURRENT_JOBS: usize = 10;
172172
const MAX_JOBS_TO_FETCH: usize = 5;
173173

174174
// How many attempts a job should be retried
175-
const MAX_ATTEMPTS: usize = 5;
175+
const MAX_ATTEMPTS: usize = 10;
176176

177177
/// Returns the delay to wait before retrying a job
178178
///
179-
/// Uses an exponential backoff: 1s, 2s, 4s, 8s, 16s
179+
/// Uses an exponential backoff: 5s, 10s, 20s, 40s, 1m20s, 2m40s, 5m20s, 10m50s,
180+
/// 21m40s, 43m20s
180181
fn retry_delay(attempt: usize) -> Duration {
181182
let attempt = u32::try_from(attempt).unwrap_or(u32::MAX);
182-
Duration::milliseconds(2_i64.saturating_pow(attempt) * 1000)
183+
Duration::milliseconds(2_i64.saturating_pow(attempt) * 5_000)
183184
}
184185

185186
type JobResult = Result<(), JobError>;

0 commit comments

Comments
 (0)