Open the COB cache database once per driver

This commit is contained in:
Rūdolfs Ošiņš
2026-07-03 11:33:01 +02:00
parent 151db44c28
commit ce5e270ecb
2 changed files with 6 additions and 10 deletions
+3 -5
View File
@@ -77,14 +77,12 @@ pub(crate) fn startup(app: AppHandle) -> Result<Config, Error> {
let inbox_db = radicle_types::outbound::sqlite::Sqlite::reader(
profile.node().join(NOTIFICATIONS_DB_FILE),
)?;
let patch_db =
radicle_types::outbound::sqlite::Sqlite::reader(profile.cobs().join(COBS_DB_FILE))?;
let issue_db =
let cobs_db =
radicle_types::outbound::sqlite::Sqlite::reader(profile.cobs().join(COBS_DB_FILE))?;
let inbox_service = domain::inbox::service::Service::new(inbox_db);
let patch_service = domain::patch::service::Service::new(patch_db);
let issue_service = domain::issue::service::Service::new(issue_db);
let patch_service = domain::patch::service::Service::new(cobs_db.clone());
let issue_service = domain::issue::service::Service::new(cobs_db);
let node_handle = app.app_handle().clone();
+3 -5
View File
@@ -30,12 +30,10 @@ pub async fn run(options: Options) -> anyhow::Result<()> {
fn router(profile: Profile) -> anyhow::Result<Router> {
let profile = Arc::new(profile);
let patch_db =
let cobs_db =
radicle_types::outbound::sqlite::Sqlite::reader(profile.cobs().join(COBS_DB_FILE))?;
let patch_service = PatchService::new(patch_db);
let issue_db =
radicle_types::outbound::sqlite::Sqlite::reader(profile.cobs().join(COBS_DB_FILE))?;
let issue_service = IssueService::new(issue_db);
let patch_service = PatchService::new(cobs_db.clone());
let issue_service = IssueService::new(cobs_db);
let ctx = api::Context::new(profile, Arc::new(patch_service), Arc::new(issue_service));