mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
Log error on pause guard drop without resuming instead of working around
I checked that tests still pass even if error! is replaced with panic!
This commit is contained in:
@@ -219,14 +219,9 @@ impl<'a> Drop for IoPausedGuard<'a> {
|
||||
if self.done {
|
||||
return;
|
||||
}
|
||||
let context = self.context.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut inner = context.scheduler.inner.write().await;
|
||||
inner.paused = false;
|
||||
if inner.started && inner.scheduler.is_none() {
|
||||
SchedulerState::do_start(inner, context.clone()).await;
|
||||
}
|
||||
});
|
||||
|
||||
// Async .resume() should be called manually due to lack of async drop.
|
||||
error!(self.context, "Pause guard dropped without resuming.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user