fix(core): avoid holding pool registry locks during db io

This commit is contained in:
Guoyu Su authored and GitHub committed 2026-09-03 01:53:42 +08:00
1 parent 616c0daf25
commit d6fc1fe52c
30 files changed
+1436 -1110

No files matched your search

@@ -85,8 +85,8 @@ async fn native_sqlite_pool(
) -> Result<(String, db::sqlite::SqliteHandle), String> {
let database = (!database.trim().is_empty()).then_some(database);
let pool_key = state.get_or_create_pool(connection_id, database).await?;
let connections = state.connections.read().await;
match connections.get(&pool_key) {
let pool_handle = state.pool_handle(&pool_key).await;
match pool_handle.as_ref() {
Some(PoolKind::Sqlite(pool)) => Ok((pool_key, pool.clone())),
Some(_) => Err("SQLite table rebuild is only available for native SQLite connections.".to_string()),
None => Err("SQLite connection pool not found.".to_string()),