docs: comment std::process::exit(0) intent in M_UNKNOWN_TOKEN recovery

This commit is contained in:
damocles 2026-06-04 11:42:45 +02:00 committed by mara
commit 186ee430b5

View file

@ -84,6 +84,12 @@ pub async fn build_and_restore(
"failed to remove sdk state dir; next startup may fail with stale state"
);
}
// Exit 0 rather than returning Err: `hive-matrix-daemon` is a
// single-purpose process binary; the call site is before any
// tasks are spawned so there are no resources to clean up.
// Using exit(0) (not Err) keeps systemd's Restart=on-failure
// from looping — the systemd.paths watcher re-launches us
// once hive-c0re writes a fresh token file.
std::process::exit(0);
}
return Err(e);