MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / rolloutDelayForBucket

Function rolloutDelayForBucket

apps/kimi-code/src/cli/update/rollout.ts:34–44  ·  view source on GitHub ↗
(rollout: readonly RolloutBatch[], bucket: number)

Source from the content-addressed store, hash-verified

32 * fall into the slowest cohort, and oversized delays are clamped to 24h.
33 */
34export function rolloutDelayForBucket(rollout: readonly RolloutBatch[], bucket: number): number {
35 let cumulative = 0;
36 for (const batch of rollout) {
37 cumulative += batch.percent;
38 if (bucket < cumulative) {
39 return Math.min(Math.max(batch.delaySeconds, 0), MAX_ROLLOUT_DELAY_SECONDS);
40 }
41 }
42 if (rollout.length === 0) return 0;
43 return MAX_ROLLOUT_DELAY_SECONDS;
44}
45
46export function rolloutDelaySeconds(manifest: UpdateManifest, deviceId: string): number {
47 return rolloutDelayForBucket(manifest.rollout, rolloutBucket(deviceId, manifest.version));

Callers 4

rollout.test.tsFile · 0.90
rolloutTelemetryForFunction · 0.90
rolloutDelaySecondsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected