Liking cljdoc? Tell your friends :D

dev.skivi.maintenance.core

Background maintenance scheduler.

Runs two classes of work on separate cadences: Short interval (maintenance-interval-ms, default 60 s): reset-locked-jobs — frees jobs orphaned by crashed workers refill-rate-limits — refills token buckets whose window has expired

Cron schedule (schedule, default '0 3 * * *'): GC tasks listed in :tasks config (gc-task-identifiers, gc-job-queues, gc-job-history).

The GC schedule is evaluated on each maintenance tick; the first tick after a scheduled time triggers the run. Last-run time is tracked in memory and resets to nil on restart (causing GC to wait for the next scheduled slot).

Background maintenance scheduler.

Runs two classes of work on separate cadences:
  Short interval (maintenance-interval-ms, default 60 s):
    reset-locked-jobs — frees jobs orphaned by crashed workers
    refill-rate-limits — refills token buckets whose window has expired

  Cron schedule (schedule, default '0 3 * * *'):
    GC tasks listed in :tasks config (gc-task-identifiers, gc-job-queues,
    gc-job-history).

The GC schedule is evaluated on each maintenance tick; the first tick
after a scheduled time triggers the run. Last-run time is tracked in memory
and resets to nil on restart (causing GC to wait for the next scheduled slot).
raw docstring

create-schedulerclj

(create-scheduler job-system)
(create-scheduler job-system config)

Creates a maintenance scheduler. Call start! to begin processing. job-system is {:pool datasource :validator validator}. config keys: :maintenance-interval-ms, :schedule, :tasks, :timezone, :retention-periods.

Creates a maintenance scheduler. Call start! to begin processing.
job-system is {:pool datasource :validator validator}.
config keys: :maintenance-interval-ms, :schedule, :tasks, :timezone, :retention-periods.
sourceraw docstring

running?clj

(running? sched)

Returns true if the maintenance loop is active.

Returns true if the maintenance loop is active.
sourceraw docstring

start!clj

(start! sched)

Starts the maintenance loop. Throws if already running. Returns scheduler.

Starts the maintenance loop. Throws if already running. Returns scheduler.
sourceraw docstring

statsclj

(stats sched)

Returns a snapshot of maintenance scheduler operational metrics. Keys: :maintenance-runs, :gc-runs, :errors.

Returns a snapshot of maintenance scheduler operational metrics.
Keys: :maintenance-runs, :gc-runs, :errors.
sourceraw docstring

stop!clj

(stop! sched)
(stop! sched timeout-ms)

Signals the loop to stop, interrupts the thread, and joins it. Returns scheduler.

Signals the loop to stop, interrupts the thread, and joins it. Returns scheduler.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close