Skip to content

Commit 6f22dbf

Browse files
committed
reset clock when resolving waitpoints
1 parent 577ab56 commit 6f22dbf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/core/src/v3/runtime/managedRuntimeManager.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { clock } from "../clock-api.js";
12
import { lifecycleHooks } from "../lifecycle-hooks-api.js";
23
import {
34
BatchTaskRunExecutionResult,
45
CompletedWaitpoint,
5-
RuntimeWait,
66
TaskRunContext,
77
TaskRunExecutionResult,
88
TaskRunFailedExecutionResult,
@@ -178,21 +178,22 @@ export class ManagedRuntimeManager implements RuntimeManager {
178178
}
179179

180180
if (!waitId) {
181-
// TODO: Handle failures better
182181
this.log("No waitId found for waitpoint", waitpoint);
183182
return;
184183
}
185184

186185
const resolve = this.resolversByWaitId.get(waitId);
187186

188187
if (!resolve) {
189-
// TODO: Handle failures better
190188
this.log("No resolver found for waitId", waitId);
191189
return;
192190
}
193191

194192
this.log("Resolving waitpoint", waitpoint);
195193

194+
// Ensure current time is accurate before resolving the waitpoint
195+
clock.reset();
196+
196197
resolve(waitpoint);
197198

198199
this.resolversByWaitId.delete(waitId);

0 commit comments

Comments
 (0)