mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +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 {
|
if self.done {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let context = self.context.clone();
|
|
||||||
tokio::spawn(async move {
|
// Async .resume() should be called manually due to lack of async drop.
|
||||||
let mut inner = context.scheduler.inner.write().await;
|
error!(self.context, "Pause guard dropped without resuming.");
|
||||||
inner.paused = false;
|
|
||||||
if inner.started && inner.scheduler.is_none() {
|
|
||||||
SchedulerState::do_start(inner, context.clone()).await;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user