quasar_jobs/retention

Database-agnostic retention policy for terminal durable jobs.

Types

pub opaque type Policy
pub type Rule {
  Completed(before: Int)
  Cancelled(before: Int)
  Discarded(before: Int)
}

Constructors

  • Completed(before: Int)
  • Cancelled(before: Int)
  • Discarded(before: Int)

Values

pub fn cancelled_for(policy: Policy, days days: Int) -> Policy

Deletes cancelled jobs after the configured number of days.

pub fn completed_for(policy: Policy, days days: Int) -> Policy

Deletes completed jobs after the configured number of days.

pub fn cutoff(rule: Rule) -> Int
pub fn discarded_for(policy: Policy, days days: Int) -> Policy

Deletes discarded jobs after the configured number of days.

pub fn new() -> Policy

Creates a policy that retains every terminal job indefinitely.

pub fn rules(policy: Policy, now: Int) -> List(Rule)

Materialises enabled rules using one common clock snapshot.

pub fn status(rule: Rule) -> String
pub fn valid(policy: Policy) -> Bool

Returns true when every configured duration is positive.

Search Document