Skip to content

Commit

Permalink
Expand cron and pruner info admonitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sorentwo committed Apr 9, 2024
1 parent cfe677f commit 1a01814
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
7 changes: 4 additions & 3 deletions lib/oban/plugins/cron.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ defmodule Oban.Plugins.Cron do
This plugin registers workers a cron-like schedule and enqueues jobs automatically. Periodic
jobs are declared as a list of `{cron, worker}` or `{cron, worker, options}` tuples.
> #### 🌟 DynamicCron {: .info}
>
> This plugin only loads the crontab statically, at boot time. To configure cron schedules
> dynamically at runtime, across your entire cluster, see the `DynamicCron` plugin in [Oban
> Pro](https://getoban.pro/docs/pro/Oban.Pro.Plugins.DynamicCron.html).
> This plugin only loads the crontab statically, at boot time. To configure cron scheduling at
> runtime, globally, across an entire cluster with scheduling guarantees and timezone overrides,
> see the `DynamicCron` plugin in [Oban Pro](https://getoban.pro/docs/pro/Oban.Pro.Plugins.DynamicCron.html).
## Using the Plugin
Expand Down
17 changes: 11 additions & 6 deletions lib/oban/plugins/pruner.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
defmodule Oban.Plugins.Pruner do
@moduledoc """
Periodically delete completed, cancelled and discarded jobs based on age.
Periodically delete `completed`, `cancelled` and `discarded` jobs based on their age.
Pruning is critical for maintaining table size and continued responsive job processing. It
is recommended for all production applications.
> #### 🌟 DynamicPruner {: .info}
>
> This plugin limited to a fixed interval and a single `max_age` check for all jobs. To prune
> on a cron-style schedule, retain jobs by a limit or age, or provide overrides for specific
> queues, workers, and job states; see Oban Pro's
> [DynamicPruner](https://getoban.pro/docs/pro/Oban.Pro.Plugins.DynamicPruner.html).
## Using the Plugin
Expand All @@ -17,11 +27,6 @@ defmodule Oban.Plugins.Pruner do
plugins: [{Oban.Plugins.Pruner, max_age: 300}],
...
> #### 🌟 DynamicPruner {: .info}
>
> To prune on a cron-style schedule, retain jobs by a limit, or provide overrides for specific
> queues, workers, and job states; see Oban Pro's [DynamicPruner](https://getoban.pro/docs/pro/Oban.Pro.Plugins.DynamicPruner.html).
## Options
* `:interval` — the number of milliseconds between pruning attempts. The default is `30_000ms`.
Expand Down

0 comments on commit 1a01814

Please sign in to comment.