mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
Process PerformJobsNeeded::AvoidDos case explicitly
This commit is contained in:
committed by
Floris Bruynooghe
parent
95b90a59dc
commit
02fe3d1b99
@@ -508,12 +508,14 @@ pub fn perform_smtp_idle(context: &Context) {
|
|||||||
let &(ref lock, ref cvar) = &*context.smtp_state.clone();
|
let &(ref lock, ref cvar) = &*context.smtp_state.clone();
|
||||||
let mut state = lock.lock().unwrap();
|
let mut state = lock.lock().unwrap();
|
||||||
|
|
||||||
if state.perform_jobs_needed == PerformJobsNeeded::AtOnce {
|
match state.perform_jobs_needed {
|
||||||
|
PerformJobsNeeded::AtOnce => {
|
||||||
info!(
|
info!(
|
||||||
context,
|
context,
|
||||||
"SMTP-idle will not be started because of waiting jobs.",
|
"SMTP-idle will not be started because of waiting jobs.",
|
||||||
);
|
);
|
||||||
} else {
|
}
|
||||||
|
PerformJobsNeeded::Not | PerformJobsNeeded::AvoidDos => {
|
||||||
let dur = get_next_wakeup_time(context, Thread::Smtp);
|
let dur = get_next_wakeup_time(context, Thread::Smtp);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
@@ -528,6 +530,7 @@ pub fn perform_smtp_idle(context: &Context) {
|
|||||||
state.idle = false;
|
state.idle = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
info!(context, "SMTP-idle ended.",);
|
info!(context, "SMTP-idle ended.",);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user