oban v2.12.0 Release Notes
Release Date: 2022-04-19 // about 2 years ago-
โจ Enhancements
๐ง [Oban] Replace queue, plugin, and peer test configuration with a single
:testing
option. Now configuring Oban for testing only requires one change, setting the test mode to either:inline
or:manual
.:inline
โjobs execute immediately within the calling process and without touching the database. This mode is simple and may not be suitable for apps with complex jobs.:manual
โjobs are inserted into the database where they can be verified and executed when desired. This mode is more advanced and trades simplicity for flexibility.
โ [Testing] Add
with_testing_mode/2
to temporarily change testing modes within the context of a function.
Once the application starts in a particular testing mode it can't be changed. That's inconvenient if you're running in
:inline
mode and don't want a particular job to execute inline.๐ง [Config] Add
validate/1
to aid in testing dynamic Oban configuration.๐ [Config] Validate full plugin and queue options on init, without the need to start plugins or queues.
[Peers.Global] Add an alternate
:global
powered peer module.๐ [Plugin] A new
Oban.Plugin
behaviour formalizes starting and validating plugins. The behaviour is implemented by all plugins, and is the foundation of enhanced config validation.๐ [Plugin] Emit
[:oban, :plugin, :init]
event on init from every plugin.
๐ Bug Fixes
- ๐ท [Executor ] Skip timeout check with an unknown worker
When the worker can't be resolved we don't need to check the timeout. Doing so prevents returning a helpful "unknown worker" message, and instead causes a function error for
nil.timeout/1
.- โ
[Testing] Include
log
andprefix
in generated conf forperform_job
.
The opts, and subsequent conf, built for
perform_job
didn't include theprefix
orlog
options. That prevented functions that depend on a job'sconf
withinperform/1
from running with the correct options.๐ง [Drainer] Retain the currently configured engine while draining a queue.
[Watchman] Skip pausing queues when shutdown is immediate. This prevents queue's from interacting with the database during short test runs.
๐ For changes prior to v2.12 see the v2.11 docs.
๐ [opc]: https://getoban.pro/docs/pro/changelog.html ๐ [owc]: https://getoban.pro/docs/web/changelog.html