@genroc/eval-node 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/worker.js +3 -3
- package/package.json +1 -1
- package/worker.ts +4 -4
package/dist/worker.js
CHANGED
|
@@ -166,9 +166,9 @@ async function answer(token, outcome) {
|
|
|
166
166
|
await release(token);
|
|
167
167
|
}
|
|
168
168
|
async function run(job, signal) {
|
|
169
|
-
// The task's own timeout is the script's budget
|
|
170
|
-
// objects below spends the same deadline.
|
|
171
|
-
const due = job.
|
|
169
|
+
// The task's own timeout is the script's budget, moved onto the monotonic clock so a wall-clock
|
|
170
|
+
// step mid-run cannot stretch it. Fetching the objects below spends the same deadline.
|
|
171
|
+
const due = job.deadline === undefined ? undefined : performance.now() + (Date.parse(job.deadline) - Date.now());
|
|
172
172
|
let resolved;
|
|
173
173
|
try {
|
|
174
174
|
resolved = await resolveObjects(job);
|
package/package.json
CHANGED
package/worker.ts
CHANGED
|
@@ -42,7 +42,7 @@ type QueueTask = {
|
|
|
42
42
|
task: string;
|
|
43
43
|
external_input: unknown;
|
|
44
44
|
objects?: ObjectEntry[];
|
|
45
|
-
|
|
45
|
+
deadline?: string;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
// Large values arrive as refs; a bundle is one object per definition version, fetched once.
|
|
@@ -188,9 +188,9 @@ async function answer(token: string, outcome: Record<string, unknown>): Promise<
|
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
async function run(job: QueueTask, signal: AbortSignal): Promise<void> {
|
|
191
|
-
// The task's own timeout is the script's budget
|
|
192
|
-
// objects below spends the same deadline.
|
|
193
|
-
const due = job.
|
|
191
|
+
// The task's own timeout is the script's budget, moved onto the monotonic clock so a wall-clock
|
|
192
|
+
// step mid-run cannot stretch it. Fetching the objects below spends the same deadline.
|
|
193
|
+
const due = job.deadline === undefined ? undefined : performance.now() + (Date.parse(job.deadline) - Date.now());
|
|
194
194
|
let resolved: unknown;
|
|
195
195
|
try {
|
|
196
196
|
resolved = await resolveObjects(job);
|