MCPcopy Index your code
hub / github.com/codeaashu/claude-code / jitterFrac

Function jitterFrac

src/utils/cronTasks.ts:362–365  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

360 * fleet. Non-hex ids (hand-edited JSON) fall back to 0 = no jitter.
361 */
362function jitterFrac(taskId: string): number {
363 const frac = parseInt(taskId.slice(0, 8), 16) / 0x1_0000_0000
364 return Number.isFinite(frac) ? frac : 0
365}
366
367/**
368 * Same as {@link nextCronRunMs}, plus a deterministic per-task delay to

Callers 2

jitteredNextCronRunMsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected