fix: explicitly close the database on account removal

This commit is contained in:
link2xt
2024-07-29 21:52:02 +00:00
parent 0cdf9b8f9c
commit 6dd2f16df1
2 changed files with 2 additions and 1 deletions

View File

@@ -165,6 +165,7 @@ impl Accounts {
.remove(&id)
.with_context(|| format!("no account with id {id}"))?;
ctx.stop_io().await;
ctx.sql.close().await;
drop(ctx);
if let Some(cfg) = self.config.get_account(id) {

View File

@@ -126,7 +126,7 @@ impl Sql {
}
/// Closes all underlying Sqlite connections.
async fn close(&self) {
pub(crate) async fn close(&self) {
let _ = self.pool.write().await.take();
// drop closes the connection
}