diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-05-21 10:43:08 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-21 10:43:08 +0700 |
| commit | 8dc8448de0b9acaf9c3c27556d3c6c4342d8d493 (patch) | |
| tree | a0fc95ebb1bf2fd2f923ac54634c8c021d93e476 /crates/atuin-daemon | |
| parent | chore(deps): bump tokio from 1.36.0 to 1.37.0 (#2033) (diff) | |
| download | atuin-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.rs | 5 |
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 { |
