From 4c8508ae1772b82fbce9138a8be3a2b72300d885 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 16 Feb 2026 13:48:09 -0800 Subject: [PATCH] Debug: Add heartbeat notification --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 4f1f5e4..e53db61 100644 --- a/index.js +++ b/index.js @@ -460,6 +460,11 @@ export class MyDurableObject { async Heart() { if (this.phase !== 'running' || !this.hbActive) return this.stopHeartbeat(); + + ///////////// Debug: To be removed + this.notify(`Heartbeat for ${this.rid}: age ${this.age}`, 3, ['heartbeat']); + ///////////// Debug: To be removed + if (++this.age * HB_INTERVAL_MS >= MAX_RUN_MS) return this.fail(`Run timed out after ${MAX_RUN_MS / 60000} minutes.`); await this.state.storage.setAlarm(Date.now() + HB_INTERVAL_MS).catch(() => {}); }