aboutsummaryrefslogtreecommitdiffstats
path: root/crates/daemon/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/daemon/src/lib.rs')
-rw-r--r--crates/daemon/src/lib.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/daemon/src/lib.rs b/crates/daemon/src/lib.rs
index 4f96e410..c6877096 100644
--- a/crates/daemon/src/lib.rs
+++ b/crates/daemon/src/lib.rs
@@ -12,10 +12,7 @@ use fs4::fs_std::FileExt;
use tokio::time::sleep;
use crate::{
- aclient::{
- database::ClientSqlite as HistoryDatabase, record::sqlite_store::SqliteStore,
- settings::Settings,
- },
+ aclient::{database::ClientSqlite, record::sqlite_store::SqliteStore, settings::Settings},
api::{
DAEMON_VERSION,
server::{control::ControlService, history::HistoryService},
@@ -34,17 +31,13 @@ pub(crate) mod server;
///
/// This creates a daemon,
/// starts the gRPC server with services, and runs the event loop.
-pub async fn boot(
- settings: Settings,
- store: SqliteStore,
- history_db: HistoryDatabase,
-) -> Result<()> {
+pub async fn boot(settings: Settings, store: SqliteStore, history_db: ClientSqlite) -> Result<()> {
let pidfile_path = PathBuf::from(&settings.daemon.pidfile_path);
let _pidfile_guard = PidfileGuard::acquire(&pidfile_path)?;
let mut daemon = Daemon::builder(settings.clone())
.store(store)
- .history_db(history_db)
+ .history_db(history_db.clone())
.build()?;
let handle = {
@@ -61,7 +54,7 @@ pub async fn boot(
handle
};
- let history_service = HistoryService::new(handle.clone()).await?;
+ let history_service = HistoryService::new(handle.clone(), history_db).await?;
let control_service = ControlService::new(handle.clone());
server::run_grpc_server(