@ultimat3/jobs 30.6.0 → 30.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/jobs",
3
- "version": "30.6.0",
3
+ "version": "30.7.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.6.0",
48
- "@ultimat3/db": "30.6.0",
49
- "@ultimat3/entity": "30.6.0",
50
- "@ultimat3/http": "30.6.0",
51
- "@ultimat3/schema": "30.6.0",
52
- "@ultimat3/time": "30.6.0"
47
+ "@ultimat3/core": "30.7.0",
48
+ "@ultimat3/db": "30.7.0",
49
+ "@ultimat3/entity": "30.7.0",
50
+ "@ultimat3/http": "30.7.0",
51
+ "@ultimat3/schema": "30.7.0",
52
+ "@ultimat3/time": "30.7.0"
53
53
  }
54
54
  }
@@ -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
- const remaining = lastAt === undefined ? 0 : intervalMs - (at - lastAt);
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;