mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-09 05:30:28 +08:00
Open the COB cache database once per driver
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user