From 26c5434ba43d7dcf7b776b05a6f42a5823f987cb Mon Sep 17 00:00:00 2001 From: hoelee Date: Mon, 27 Jul 2026 09:00:00 +0800 Subject: [PATCH] feat(shell-sync): run_daemon() part 2/3 --- platform/shell-sync/sync.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/shell-sync/sync.sh b/platform/shell-sync/sync.sh index 4731fe80..0f303a37 100644 --- a/platform/shell-sync/sync.sh +++ b/platform/shell-sync/sync.sh @@ -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 +} +