* taskId is an 8-hex-char UUID slice (see addCronTask) → parse as * u32 → [0, 1). Stable across restarts, uniformly distributed across the * fleet. Non-hex ids (hand-edited JSON) fall back to 0 = no jitter.
(taskId: string)
| 378 | * fleet. Non-hex ids (hand-edited JSON) fall back to 0 = no jitter. |
| 379 | */ |
| 380 | function jitterFrac(taskId: string): number { |
| 381 | const frac = parseInt(taskId.slice(0, 8), 16) / 0x1_0000_0000 |
| 382 | return Number.isFinite(frac) ? frac : 0 |
| 383 | } |
| 384 | |
| 385 | /** |
| 386 | * Same as {@link nextCronRunMs}, plus a deterministic per-task delay to |
no outgoing calls
no test coverage detected