Stale-detection sweeps for coordinators and claims.
Pure side-effect cleanup ops. Owns the staleness policy via CoordinationConfig (env-overridable thresholds). Sibling to coordination.coordinator (which owns coordinator CRUD); kept separate per SRP: these have a different reason to change (threshold tuning, sweep cadence) than the CRUD ops.
Stale-detection sweeps for coordinators and claims. Pure side-effect cleanup ops. Owns the staleness policy via CoordinationConfig (env-overridable thresholds). Sibling to coordination.coordinator (which owns coordinator CRUD); kept separate per SRP: these have a different reason to change (threshold tuning, sweep cadence) than the CRUD ops.
(cleanup-old-claim-history! &
[{:keys [threshold-ms]
:or {threshold-ms default-ledger-retain-ms}}])Retract claim-history rows older than the retain window. Every row is durable in the ledger (archive-claim-to-history! appends). Returns count retracted.
Retract claim-history rows older than the retain window. Every row is durable in the ledger (archive-claim-to-history! appends). Returns count retracted.
(cleanup-stale-claims! &
[{:keys [threshold-ms]
:or {threshold-ms (:claim-stale-ms
(config/coordination-config))}}])Remove claims older than threshold with no heartbeat.
Arguments: threshold-ms - Age threshold in milliseconds (default: :claim-stale-ms from CoordinationConfig)
Returns: Count of claims removed
Remove claims older than threshold with no heartbeat.
Arguments:
threshold-ms - Age threshold in milliseconds
(default: :claim-stale-ms from CoordinationConfig)
Returns:
Count of claims removed(cleanup-stale-coordinators!
&
[{:keys [threshold-ms]
:or {threshold-ms (:coordinator-stale-ms (config/coordination-config))}}])Find and mark coordinators as stale if their heartbeat is too old. Returns coordinators that were marked stale.
Arguments: threshold-ms - Optional custom threshold in ms (default: :coordinator-stale-ms from CoordinationConfig)
Returns: Seq of coordinator-ids that were marked stale
Find and mark coordinators as stale if their heartbeat is too old.
Returns coordinators that were marked stale.
Arguments:
threshold-ms - Optional custom threshold in ms
(default: :coordinator-stale-ms from CoordinationConfig)
Returns:
Seq of coordinator-ids that were marked stale(cleanup-terminal-tasks! &
[{:keys [threshold-ms]
:or {threshold-ms default-ledger-retain-ms}}])Retract completed/failed tasks older than the retain window. Live tasks (no :task/completed-at, or non-terminal status) are never touched. The :task/completed-at gate is set only by complete-task!/fail-task!, which append to the ledger, so every retracted task is already durable. Returns count retracted.
Retract completed/failed tasks older than the retain window. Live tasks (no :task/completed-at, or non-terminal status) are never touched. The :task/completed-at gate is set only by complete-task!/fail-task!, which append to the ledger, so every retracted task is already durable. Returns count retracted.
Grace window a terminal entity stays queryable in the hot DataScript store after completion before retraction. Its durable record already lives in the swarm ledger, so retraction loses nothing.
Grace window a terminal entity stays queryable in the hot DataScript store after completion before retraction. Its durable record already lives in the swarm ledger, so retraction loses nothing.
(sweep-ledger-cold! & [opts])Retract terminal/cold swarm entities from the hot DataScript store once they age past the retain window; their durable record lives in the swarm ledger. Terminal-state guarded: live entities are never swept. Returns a summary map.
Retract terminal/cold swarm entities from the hot DataScript store once they age past the retain window; their durable record lives in the swarm ledger. Terminal-state guarded: live entities are never swept. Returns a summary map.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |