cronutil

package
v0.19.1127 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxJitterWindow = time.Hour

MaxJitterWindow requests the widest spread ApplyCronJitter can express; the effective jitter is still capped at each schedule's firing interval.

Variables

This section is empty.

Functions

func ApplyCronJitter

func ApplyCronJitter(emitterID, schedule string, window time.Duration) string

ApplyCronJitter deterministically shifts the minute field of a standard 5-field cron expression by hash(emitterID) minutes. Mirrors Temporal schedule jitter semantics: window is a maximum — the effective jitter is capped at the schedule's shortest firing interval and at one hour. Never fails; anything unsupported returns the schedule unchanged.

func MinScheduleInterval added in v0.19.1088

func MinScheduleInterval(sched cron.Schedule) time.Duration

MinScheduleInterval returns the smallest gap between two consecutive fires of the given schedule, sampled over the next minIntervalProbeFires fires.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL