dont run perform_cleanup twice on shutdown

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-03-06 18:00:16 -05:00 committed by June
parent 3b90932cff
commit b5ef72826e

View file

@ -1093,19 +1093,19 @@ impl KeyValueDatabase {
debug!(target: "database-cleanup","Received SIGHUP");
}
_ = ctrl_c.recv() => {
debug!(target: "database-cleanup", "Received Ctrl+C, performing last cleanup");
perform_cleanup();
debug!(target: "database-cleanup", "Received Ctrl+C");
}
_ = terminate.recv() => {
debug!(target: "database-cleanup","Received SIGTERM, performing last cleanup");
perform_cleanup();
debug!(target: "database-cleanup","Received SIGTERM");
}
};
#[cfg(not(unix))]
{
i.tick().await;
debug!(target: "database-cleanup", "Timer ticked")
}
perform_cleanup();
}
});