Skip to content

Commit 239eb33

Browse files
committed
fix: only restart daemon on crash, not clean exit
1 parent 370488d commit 239eb33

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
142142
service do
143143
run [opt_bin/"lore", "daemon", "start", "--foreground"]
144-
keep_alive true
144+
keep_alive crashed: true
145145
log_path var/"log/lore.log"
146146
error_log_path var/"log/lore.log"
147147
working_dir HOMEBREW_PREFIX

src/daemon/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,16 @@ pub async fn run_daemon() -> Result<()> {
6868
// Check if lore has been initialized
6969
let config_path = Config::config_path()?;
7070
if !config_path.exists() {
71-
anyhow::bail!(
72-
"Lore has not been initialized.\n\n\
71+
eprintln!(
72+
"Error: Lore has not been initialized.\n\n\
7373
Run 'lore init' first to:\n \
7474
- Select which AI tools to watch\n \
7575
- Configure your machine identity\n \
7676
- Import existing sessions\n\n\
7777
Then start the daemon with 'lore daemon start' or let init do it for you."
7878
);
79+
// Exit with code 0 so launchd doesn't treat this as a crash and restart
80+
std::process::exit(0);
7981
}
8082

8183
// Set up file logging

0 commit comments

Comments
 (0)