Skip to content

Commit 3cf277b

Browse files
committed
fix(core): bound the new cancel request with a timeout
1 parent 164d81c commit 3cf277b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/core/src/v3/serverOnly/checkpointClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export type CheckpointClientOptions = {
1313
orchestrator: CheckpointType;
1414
};
1515

16+
const CANCEL_TIMEOUT_MS = 5_000;
17+
1618
export class CheckpointClient {
1719
private readonly logger = new SimpleStructuredLogger("checkpoint-client");
1820

@@ -161,7 +163,7 @@ export class CheckpointClient {
161163
async cancelCheckpoints({ runFriendlyId }: { runFriendlyId: string }): Promise<boolean> {
162164
const res = await fetch(
163165
new URL(`/api/v1/runs/${runFriendlyId}/checkpoints/cancel`, this.opts.apiUrl),
164-
{ method: "POST" }
166+
{ method: "POST", signal: AbortSignal.timeout(CANCEL_TIMEOUT_MS) }
165167
);
166168

167169
if (!res.ok) {

0 commit comments

Comments
 (0)