Gracefully shut down on SIGINT/SIGTERM
This commit is contained in:
parent
e76c94a57c
commit
4914b03fcd
2 changed files with 34 additions and 6 deletions
|
|
@ -46,4 +46,9 @@ impl AppState {
|
|||
db: pool(db_path).await?,
|
||||
})
|
||||
}
|
||||
|
||||
pub async fn shut_down(self) {
|
||||
info!("Closing db");
|
||||
self.db.close().await;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue