Durable.Pruner (Durable v2.0.2)

View Source

Deletes finished runs older than the :prune config, once an hour. Steps, pending inputs, events and wait groups go with their run (foreign keys cascade); child runs keep living and are pruned on their own age.

Deletes go in batches of 5000 with FOR UPDATE SKIP LOCKED, so every node can run the pruner without stepping on the others or holding long locks. Running and waiting runs are never pruned.

Each batch emits [:durable, :pruner, :pruned] with %{count} and the :group (:completed, :failed or :cancelled).

Summary

Functions

Returns a specification to start this module under a supervisor.

Prunes now. Returns how many runs were deleted per group.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

prune(config)

@spec prune(Durable.Config.t()) :: %{required(atom()) => non_neg_integer()}

Prunes now. Returns how many runs were deleted per group.

start_link(opts)