From 8dc8448de0b9acaf9c3c27556d3c6c4342d8d493 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Tue, 21 May 2024 10:43:08 +0700 Subject: fix(daemon): do not try to sync if logged out (#2037) * fix(daemon): do not try to sync if logged out I've also added Settings::logged_in, as there are a few places where we switch on login state. * make session_token a function --- crates/atuin-daemon/src/server/sync.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/atuin-daemon/src/server/sync.rs') diff --git a/crates/atuin-daemon/src/server/sync.rs b/crates/atuin-daemon/src/server/sync.rs index 22c8d307..0724a250 100644 --- a/crates/atuin-daemon/src/server/sync.rs +++ b/crates/atuin-daemon/src/server/sync.rs @@ -38,6 +38,11 @@ pub async fn worker( ticker.tick().await; tracing::info!("sync worker tick"); + if !settings.logged_in() { + tracing::debug!("not logged in, skipping sync tick"); + continue; + } + let res = sync::sync(&settings, &store).await; if let Err(e) = res { -- cgit v1.3.1