mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 16:26:31 +03:00
Refine type of SmtpState.doing_jobs to bool
This commit is contained in:
@@ -107,7 +107,7 @@ impl Default for BobStatus {
|
|||||||
pub struct SmtpState {
|
pub struct SmtpState {
|
||||||
pub idle: bool,
|
pub idle: bool,
|
||||||
pub suspended: bool,
|
pub suspended: bool,
|
||||||
pub doing_jobs: i32,
|
pub doing_jobs: bool,
|
||||||
pub perform_jobs_needed: i32,
|
pub perform_jobs_needed: i32,
|
||||||
pub probe_network: bool,
|
pub probe_network: bool,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ unsafe fn dc_suspend_smtp_thread(context: &Context, suspend: bool) {
|
|||||||
context.smtp_state.0.lock().unwrap().suspended = suspend;
|
context.smtp_state.0.lock().unwrap().suspended = suspend;
|
||||||
if suspend {
|
if suspend {
|
||||||
loop {
|
loop {
|
||||||
if context.smtp_state.0.lock().unwrap().doing_jobs == 0 {
|
if !context.smtp_state.0.lock().unwrap().doing_jobs {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::thread::sleep(std::time::Duration::from_micros(300 * 1000));
|
std::thread::sleep(std::time::Duration::from_micros(300 * 1000));
|
||||||
@@ -1049,7 +1049,7 @@ pub unsafe fn dc_perform_smtp_jobs(context: &Context) {
|
|||||||
info!(context, 0, "SMTP-jobs suspended.",);
|
info!(context, 0, "SMTP-jobs suspended.",);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.doing_jobs = 1;
|
state.doing_jobs = true;
|
||||||
probe_smtp_network
|
probe_smtp_network
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1061,7 +1061,7 @@ pub unsafe fn dc_perform_smtp_jobs(context: &Context) {
|
|||||||
let &(ref lock, _) = &*context.smtp_state.clone();
|
let &(ref lock, _) = &*context.smtp_state.clone();
|
||||||
let mut state = lock.lock().unwrap();
|
let mut state = lock.lock().unwrap();
|
||||||
|
|
||||||
state.doing_jobs = 0;
|
state.doing_jobs = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user