quasar_postgres/retention
Periodic, bounded PostgreSQL cleanup for terminal Quasar jobs.
Types
pub type Event {
BatchCompleted(
status: String,
requested: Int,
deleted: Int,
duration_ms: Int,
)
BatchFailed(status: String, reason: pog.QueryError)
CycleCompleted(deleted: Int)
}
Constructors
-
BatchCompleted( status: String, requested: Int, deleted: Int, duration_ms: Int, ) -
BatchFailed(status: String, reason: pog.QueryError) -
CycleCompleted(deleted: Int)
pub type StartError {
InvalidConfig
ActorStart(actor.StartError)
}
Constructors
-
InvalidConfig -
ActorStart(actor.StartError)
Values
pub fn new(
connection: pog.Connection,
policy: retention.Policy,
) -> Config
Builds a conservative cleanup configuration.
Defaults: 1,000 rows per batch, 100 ms between batches, and one cycle per minute. Disabled policy states are never touched.
pub fn start(config: Config) -> Result(Runtime, StartError)
Starts a linked retention worker. Stop it before closing the Pog pool.