Gracefully shut down on SIGINT/SIGTERM

This commit is contained in:
Joscha 2023-08-04 16:25:16 +02:00
parent e76c94a57c
commit 4914b03fcd
2 changed files with 34 additions and 6 deletions

View file

@ -46,4 +46,9 @@ impl AppState {
db: pool(db_path).await?,
})
}
pub async fn shut_down(self) {
info!("Closing db");
self.db.close().await;
}
}