mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
Use sync RwLock for debug_logging
This avoids the need for potentially expensive block_in_place(), but is unlikely to actually block the thread as holding write lock is rare.
This commit is contained in:
@@ -105,7 +105,12 @@ impl SchedulerState {
|
||||
// to allow for clean shutdown.
|
||||
context.new_msgs_notify.notify_one();
|
||||
|
||||
if let Some(debug_logging) = context.debug_logging.read().await.as_ref() {
|
||||
if let Some(debug_logging) = context
|
||||
.debug_logging
|
||||
.read()
|
||||
.expect("RwLock is poisoned")
|
||||
.as_ref()
|
||||
{
|
||||
debug_logging.loop_handle.abort();
|
||||
}
|
||||
let prev_state = std::mem::replace(&mut *inner, new_state);
|
||||
|
||||
Reference in New Issue
Block a user