diff --git a/src/bot_manager.rs b/src/bot_manager.rs index 1c72e0a..5d91685 100644 --- a/src/bot_manager.rs +++ b/src/bot_manager.rs @@ -218,9 +218,10 @@ pub async fn spawn_notificator_thread( rt.block_on(async { loop { - let r = c.runtime.lock().expect("Poisoned Runtime lock"); - let notifications = r.rc.get_nearest_notifications(); - drop(r); // unlocking mutex + let notifications = { + let r = c.runtime.lock().expect("Poisoned Runtime lock"); + r.rc.get_nearest_notifications() + }; match notifications { Some(n) => {