fuzzycrontab

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 6 Imported by: 0

README

fuzzycrontab

master build

Boost your crontabs with Jenkins-style hashed cron expressions.

These hashes allow for more uniform distribution of your workloads across time. Like with Jenkins, the hashes are deterministic based on a given string basis (with Jenkins as per-job name).

Description

The hash is based on whatever string is given allowing for crons with the same cadence to be scheduled differently, distributing your workloads more evenly. The hash is evaluated differently per field index in the cron expression ensuring spread from field to field when evaluated for the same range.

Given that the evaluation is deterministic based on the string provided an individual job should be evaluated the same every time ensuring no gaps in your expected cadence.

Some sample expressions supported (along with example evaluations):

H H H H H
-> 20 19 11 6 4

H H * H/2 *
-> 18 17 * 1/2 *

H(5-15)/20 H/5 * * *
-> 12/20 3/5 * * *

H(0-5) * * * *
-> 4 * * * *

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalCrontab

func EvalCrontab(crontab string, name string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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