abort GC on server shutdown

This commit is contained in:
Dietmar Maurer
2019-04-01 12:13:02 +02:00
parent 9136f857cc
commit 92da93b245
5 changed files with 18 additions and 0 deletions

View File

@ -557,3 +557,10 @@ pub fn request_shutdown() {
pub fn shutdown_requested() -> bool {
unsafe { SHUTDOWN_REQUESTED }
}
pub fn fail_on_shutdown() -> Result<(), Error> {
if shutdown_requested() {
bail!("Server shutdown requested - aborting task");
}
Ok(())
}