feat(shell-sync): run_daemon() part 2/3

This commit is contained in:
hoelee committed 2026-07-27 09:00:00 +08:00
1 parent 4c9912dd79
commit 26c5434ba4
1 file changed
+12
+12
View File
@@ -373,3 +373,15 @@ run_daemon() {
start_heartbeat
trap 'kill "${HEARTBEAT_PID:-}" "${CRON_PID:-}" 2>/dev/null || true' EXIT
if [ -n "$SYNC_CRON" ]; then
run_cron_scheduler
return
fi
while true; do
sync_all || true
log "Sleeping ${SYNC_INTERVAL}s before the next sync cycle"
sleep "$SYNC_INTERVAL"
done
}