Route all database writes through one connection (#642)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Gregory SchierandClaude Fable 5.1 authored and GitHub committed 2026-09-13 08:12:41 -07:00
1 parent ff7eebf3cd
commit 90cb578e26
62 files changed
+2231 -1852

No files matched your search

+3 -5
View File
@@ -187,9 +187,7 @@ impl PluginManager {
}
let bundled_dirs = plugin_manager.list_bundled_plugin_dirs().await?;
// Scope the db connection so the future stays Send across the await below
let plugins = {
let db = query_manager.connect();
let plugins = query_manager.with_tx(|db| {
for dir in &bundled_dirs {
if db.get_plugin_by_directory(dir).is_none() {
db.upsert_plugin(
@@ -204,8 +202,8 @@ impl PluginManager {
)?;
}
}
db.list_plugins()?
};
db.list_plugins()
})?;
let init_errors = plugin_manager.initialize_all_plugins(plugins, plugin_context).await;
if !init_errors.is_empty() {