@ultimat3/jobs 30.6.0 → 30.8.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/package.json +7 -7
- package/src/backfill-rate.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/jobs",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.8.0",
|
|
4
4
|
"description": "Durable background work: steps, transactional outbox, cron tasks, one driver interface",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"test": "bun test"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ultimat3/core": "30.
|
|
48
|
-
"@ultimat3/db": "30.
|
|
49
|
-
"@ultimat3/entity": "30.
|
|
50
|
-
"@ultimat3/http": "30.
|
|
51
|
-
"@ultimat3/schema": "30.
|
|
52
|
-
"@ultimat3/time": "30.
|
|
47
|
+
"@ultimat3/core": "30.8.0",
|
|
48
|
+
"@ultimat3/db": "30.8.0",
|
|
49
|
+
"@ultimat3/entity": "30.8.0",
|
|
50
|
+
"@ultimat3/http": "30.8.0",
|
|
51
|
+
"@ultimat3/schema": "30.8.0",
|
|
52
|
+
"@ultimat3/time": "30.8.0"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/src/backfill-rate.ts
CHANGED
|
@@ -93,8 +93,10 @@ export function backfillPacer(options: PacerOptions): Pacer {
|
|
|
93
93
|
|
|
94
94
|
const at = nowMs(clock);
|
|
95
95
|
// The batch's own time is interval already paid, so a slow page waits for nothing and only a
|
|
96
|
-
// fast one is held back. The first batch has no previous one to be spaced from.
|
|
97
|
-
|
|
96
|
+
// fast one is held back. The first batch has no previous one to be spaced from. Capped at one
|
|
97
|
+
// interval: a clock stepped backwards (NTP, a test clock reset) would otherwise make the wait
|
|
98
|
+
// the size of the step, which no rate asked for.
|
|
99
|
+
const remaining = lastAt === undefined ? 0 : Math.min(intervalMs, intervalMs - (at - lastAt));
|
|
98
100
|
if (remaining < RESOLUTION_MS) {
|
|
99
101
|
lastAt = at;
|
|
100
102
|
return;
|