aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-daemon
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2024-05-21 10:43:08 +0700
committerGitHub <noreply@github.com>2024-05-21 10:43:08 +0700
commit8dc8448de0b9acaf9c3c27556d3c6c4342d8d493 (patch)
treea0fc95ebb1bf2fd2f923ac54634c8c021d93e476 /crates/atuin-daemon
parentchore(deps): bump tokio from 1.36.0 to 1.37.0 (#2033) (diff)
downloadatuin-8dc8448de0b9acaf9c3c27556d3c6c4342d8d493.zip
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
Diffstat (limited to 'crates/atuin-daemon')
-rw-r--r--crates/atuin-daemon/src/server/sync.rs5
1 files changed, 5 insertions, 0 deletions
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 {