mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
Calculate job backoff relative to the current time
Otherwise it is possible that desired_timestamp is in the past.
This commit is contained in:
committed by
Floris Bruynooghe
parent
f0486eb820
commit
7e66af05ff
@@ -810,11 +810,11 @@ fn job_perform(context: &Context, thread: Thread, probe_network: bool) {
|
|||||||
if tries < JOB_RETRIES {
|
if tries < JOB_RETRIES {
|
||||||
job.tries = tries;
|
job.tries = tries;
|
||||||
let time_offset = get_backoff_time_offset(tries);
|
let time_offset = get_backoff_time_offset(tries);
|
||||||
job.desired_timestamp = job.added_timestamp + time_offset;
|
job.desired_timestamp = time() + time_offset;
|
||||||
job.update(context);
|
job.update(context);
|
||||||
info!(
|
info!(
|
||||||
context,
|
context,
|
||||||
"{}-job #{} not succeeded on try #{}, retry in ADD_TIME+{} (in {} seconds).",
|
"{}-job #{} not succeeded on try #{}, retry in {} seconds.",
|
||||||
if thread == Thread::Imap {
|
if thread == Thread::Imap {
|
||||||
"INBOX"
|
"INBOX"
|
||||||
} else {
|
} else {
|
||||||
@@ -822,8 +822,7 @@ fn job_perform(context: &Context, thread: Thread, probe_network: bool) {
|
|||||||
},
|
},
|
||||||
job.job_id as u32,
|
job.job_id as u32,
|
||||||
tries,
|
tries,
|
||||||
time_offset,
|
time_offset
|
||||||
job.added_timestamp + time_offset - time()
|
|
||||||
);
|
);
|
||||||
if thread == Thread::Smtp && tries < JOB_RETRIES - 1 {
|
if thread == Thread::Smtp && tries < JOB_RETRIES - 1 {
|
||||||
context
|
context
|
||||||
|
|||||||
Reference in New Issue
Block a user