Skip to content

Commit 9daf4df

Browse files
committed
track last heartbeat
1 parent 0d5bb97 commit 9daf4df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/cli-v3/src/entryPoints/managed/execution.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export class RunExecution {
6464
private taskRunProcess?: TaskRunProcess;
6565
private snapshotPoller?: RunExecutionSnapshotPoller;
6666

67+
private lastHeartbeat?: Date;
68+
6769
constructor(opts: RunExecutionOptions) {
6870
this.id = randomBytes(4).toString("hex");
6971
this.workerManifest = opts.workerManifest;
@@ -884,6 +886,8 @@ export class RunExecution {
884886
if (!response.success) {
885887
this.sendDebugLog("Heartbeat: failed", { error: response.error });
886888
}
889+
890+
this.lastHeartbeat = new Date();
887891
}
888892

889893
sendDebugLog(
@@ -900,6 +904,7 @@ export class RunExecution {
900904
snapshotId: this.currentSnapshotId,
901905
executionId: this.id,
902906
executionRestoreCount: this.restoreCount,
907+
lastHeartbeat: this.lastHeartbeat?.toISOString(),
903908
},
904909
});
905910
}

0 commit comments

Comments
 (0)