mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
scheduler: add comment about fake-idle timeout
This commit is contained in:
@@ -327,7 +327,7 @@ async fn smtp_loop(ctx: Context, started: Sender<()>, smtp_handlers: SmtpConnect
|
|||||||
if let Err(err) = &res {
|
if let Err(err) = &res {
|
||||||
warn!(ctx, "send_smtp_messages failed: {:#}", err);
|
warn!(ctx, "send_smtp_messages failed: {:#}", err);
|
||||||
}
|
}
|
||||||
let success = res.unwrap_or_default();
|
let success = res.unwrap_or(false);
|
||||||
timeout = if success {
|
timeout = if success {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
@@ -341,6 +341,10 @@ async fn smtp_loop(ctx: Context, started: Sender<()>, smtp_handlers: SmtpConnect
|
|||||||
Some(err) => connection.connectivity.set_err(&ctx, err).await,
|
Some(err) => connection.connectivity.set_err(&ctx, err).await,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If send_smtp_messages() failed, we set a timeout for the fake-idle so that
|
||||||
|
// sending is retried (at the latest) after the timeout. If sending fails
|
||||||
|
// again, we increase the timeout exponentially, in order not to do lots of
|
||||||
|
// unnecessary retries.
|
||||||
if let Some(timeout) = timeout {
|
if let Some(timeout) = timeout {
|
||||||
info!(
|
info!(
|
||||||
ctx,
|
ctx,
|
||||||
|
|||||||
Reference in New Issue
Block a user