From fcf0dd12bf8437086fe2e92250ba25570d118e22 Mon Sep 17 00:00:00 2001 From: Codex Date: Sat, 27 Jun 2026 07:55:37 +0000 Subject: [PATCH] fix: support per-sentinel scheduler timers --- scripts/web-probe-sentinel-scheduler.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/web-probe-sentinel-scheduler.ts b/scripts/web-probe-sentinel-scheduler.ts index 1c4c7f51..5e8faea1 100644 --- a/scripts/web-probe-sentinel-scheduler.ts +++ b/scripts/web-probe-sentinel-scheduler.ts @@ -125,7 +125,7 @@ async function runScheduler(options: SchedulerOptions): Promise { const status = due ? options.dryRun ? "due-dry-run" : trigger?.status ?? "due" : "fresh"; const row = rowFor(schedule, before, due, status, trigger); rows.push(row); - appendEvent({ at: new Date().toISOString(), node: options.node, lane: options.lane, ...row, valuesRedacted: true }); + if (!options.dryRun) appendEvent({ at: new Date().toISOString(), node: options.node, lane: options.lane, ...row, valuesRedacted: true }); } printRows(rows); @@ -257,6 +257,7 @@ function installSystemd(options: SchedulerOptions): void { const unit = systemdUnitName(options); const servicePath = `/etc/systemd/system/${unit}.service`; const timerPath = `/etc/systemd/system/${unit}.timer`; + const sentinelArg = options.sentinelId === null ? "" : ` --sentinel ${options.sentinelId}`; const service = `[Unit] Description=UniDesk web-probe sentinel host cadence scheduler for ${options.node}/${options.lane} Wants=network-online.target @@ -269,7 +270,7 @@ Environment=PATH=${SYSTEMD_PATH} Environment=NO_PROXY=${SYSTEMD_NO_PROXY} Environment=no_proxy=${SYSTEMD_NO_PROXY} WorkingDirectory=${repoRoot} -ExecStart=${BUN_EXECUTABLE} ${join(repoRoot, "scripts", "web-probe-sentinel-scheduler.ts")} run --node ${options.node} --lane ${options.lane} --stale-multiplier ${options.staleMultiplier} +ExecStart=${BUN_EXECUTABLE} ${join(repoRoot, "scripts", "web-probe-sentinel-scheduler.ts")} run --node ${options.node} --lane ${options.lane}${sentinelArg} --stale-multiplier ${options.staleMultiplier} `; const timer = `[Unit] Description=Run UniDesk web-probe sentinel host cadence scheduler for ${options.node}/${options.lane} @@ -555,7 +556,8 @@ function tail(value: string, maxChars: number): string { } function systemdUnitName(options: SchedulerOptions): string { - return `unidesk-web-probe-sentinel-scheduler-${safeSegment(options.node)}-${safeSegment(options.lane)}`; + const sentinel = options.sentinelId === null ? "" : `-${safeSegment(options.sentinelId)}`; + return `unidesk-web-probe-sentinel-scheduler-${safeSegment(options.node)}-${safeSegment(options.lane)}${sentinel}`; } function safeSegment(value: string): string {