Accrue.Webhook.Pruner (accrue v0.3.1)

Copy Markdown View Source

Oban cron worker for webhook event retention (D2-34).

Deletes :succeeded and :dead webhook events older than their configured retention periods. Forced because Oban 2.21 CE's Plugins.Pruner has a single max_age that cannot differentiate between succeeded and dead events.

Configuration

  • :succeeded_retention_days -- default 14 days
  • :dead_retention_days -- default 90 days

Set either to :infinity to disable pruning for that status.

Host wiring

The host application must wire this worker into their Oban cron config:

config :my_app, Oban,
  plugins: [
    {Oban.Plugins.Cron,
     crontab: [
       {"0 3 * * *", Accrue.Webhook.Pruner}
     ]}
  ]