abort GC on server shutdown

This commit is contained in:
Dietmar Maurer committed 2019-04-01 12:13:02 +02:00
1 parent 9136f857cc
commit 92da93b245
5 files changed
+18

No files matched your search

+7
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(())
}