aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-daemon/src/daemon.rs
diff options
context:
space:
mode:
authorMichelle Tilley <michelle@michelletilley.net>2026-03-05 08:36:31 -0800
committerGitHub <noreply@github.com>2026-03-05 17:36:31 +0100
commite6ab243dfde79c50ce5661b630ed26b9a1504dae (patch)
treea8bd99d3a22f6592d91fad7766574310e7fc1dbc /crates/atuin-daemon/src/daemon.rs
parentfeat: initial draft of atuin-shell (#3206) (diff)
downloadatuin-e6ab243dfde79c50ce5661b630ed26b9a1504dae.zip
feat: Allow setting multipliers for frequency, recency, and frecency scores (#3235)
Diffstat (limited to 'crates/atuin-daemon/src/daemon.rs')
-rw-r--r--crates/atuin-daemon/src/daemon.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/crates/atuin-daemon/src/daemon.rs b/crates/atuin-daemon/src/daemon.rs
index ec0b7b68..625ca205 100644
--- a/crates/atuin-daemon/src/daemon.rs
+++ b/crates/atuin-daemon/src/daemon.rs
@@ -119,12 +119,20 @@ impl DaemonHandle {
/// via `handle.settings()` to pick up the changes.
pub async fn reload_settings(&self) -> Result<()> {
let new_settings = Settings::new()?;
- *self.state.settings.write().await = new_settings;
- self.emit(DaemonEvent::SettingsReloaded);
- tracing::info!("settings reloaded");
+ self.apply_settings(new_settings).await;
Ok(())
}
+ /// Apply already-loaded settings and emit a SettingsReloaded event.
+ ///
+ /// Use this when settings have already been loaded (e.g., from a file watcher)
+ /// to avoid parsing the config file twice.
+ pub async fn apply_settings(&self, settings: Settings) {
+ *self.state.settings.write().await = settings;
+ self.emit(DaemonEvent::SettingsReloaded);
+ tracing::info!("settings applied");
+ }
+
/// Get the encryption key.
pub fn encryption_key(&self) -> &[u8; 32] {
&self.state.encryption_key