(name, args)
| 496 | continue |
| 497 | } |
| 498 | Promise.resolve() |
| 499 | .then(async () => { |
| 500 | await finalizeActiveRun(info.directory, info.client, sessionID, { forceStale: true }) |
| 501 | await maybeRunDueJobs(info.directory, info.client, sessionID, { heartbeat: true }) |
| 502 | }) |
| 503 | .catch((error) => appendLoopLog(info.directory, "heartbeat-error", { sessionID, error: sdkErrorMessage(error) }).catch(() => {})) |
| 504 | } |
| 505 | if (!knownSessions.size && heartbeatTimer) { |
| 506 | clearInterval(heartbeatTimer) |
| 507 | heartbeatTimer = undefined |
| 508 | } |
| 509 | }, HEARTBEAT_MS) |
| 510 | } |
| 511 | function presetDefaults(name, args) { |
| 512 | const [maybeDuration, rest] = splitFirst(args) |
| 513 | const parsed = parseDuration(maybeDuration) |
| 514 | const intervalMs = parsed === null ? 0 : parsed |
| 515 | const extra = parsed === null ? String(args || "").trim() : rest |
no test coverage detected