cron

package
v6.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcNewNext

func CalcNewNext(schedule string, now time.Time) (time.Time, error)

CalcNewNext parses a cron string and calculates the next exec time based on it.

func CreatePipeline

func CreatePipeline(ctx context.Context, store store.Store, cron *model.Cron) (*model.Repo, *model.Pipeline, error)

func Run

func Run(ctx context.Context, store store.Store, lockService *lock.Service, leaderLockTTL time.Duration) error

Run starts the cron scheduler with persistent leadership.

func RunSweeper

func RunSweeper(ctx context.Context, s store.Store, q queue.Queue, interval time.Duration)

RunSweeper runs SweepExpiredApprovals on the given interval until ctx is done. The first sweep fires immediately so a server that has been down across an approval deadline does not have to wait one full interval before expiring stale gates.

func SweepExpiredApprovals

func SweepExpiredApprovals(ctx context.Context, s store.Store, q queue.Queue)

SweepExpiredApprovals scans for workflow approval gates whose deadline has passed and transitions them to the Expired state via pipeline.ExpireWorkflow. Safe to call repeatedly from a goroutine; the index on (approval_state, approval_deadline) makes each call cheap when there are no expired gates to process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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