- Reuse Job.delete in Job.mark_successful - @tpitale
- Add job_module to telemetry events - @tpitale
- Fix for db checks with multi-schema databases - @rubysolo
- DB Upgrade required: Recreate index to add NULLS FIRST on the due_at column on jobs table to fix performance of the locking query - @tpitale
- Allow users to pass a different repo as parameter
- Added
Rihanna.deleted_by/1
- Breaking change: must add
priority
column, which requires downtime. Please see Upgrading v2 for more detailed instructions.
- Drop
pool_size
from Postgrex config in addition topool
.
- Drop
pool
from Postgrex config as Rihanna requires a single dedicated connection.
- Relaxed restriction on Postgrex options in supervisor, enabling clients to use any Postgrex configuration they want.
- Fix incorrect index name being used with custom table name.
- The startup delay for the job dispatcher is now configurable.
- Rescue after_error callback errors to stop a potential infinite retry loop for a job.
- Schedule and enqueue functions now raise errors with greater detail when given incorrect arguments.
- Fix bug when creating index using a custom table name
- Add support for enqueuing job via a user supplied Postgres connection. This can be either a Postgrex process or an Ecto Repo.
- Add
Rihanna.delete
- Fix specs in migrations
- Fix callback spec for
after_error
- Fix flaky tests
- Fix bug preventing rollback of upgrade migration
- Remove
CONCURRENTLY
from migration since it doesn't play well with Ecto.
- Add missing index that massively improves performance at high loads
- Fix a SQL syntax error in migration rollback.
-
Added an optional callback per job which defines what to do when that job errors.
def after_error(failure_reason, args) do notify_someone(__MODULE__, failure_reason, args) end
-
Schedule jobs to run at a
DateTime
or in a number of milliseconds.Rihanna.schedule( {IO, :puts, ["Hello"]}, at: DateTime.from_naive!(~N[2018-07-01 12:00:00], "Etc/UTC") ) Rihanna.schedule({IO, :puts, ["Hello"]}, in: :timer.hours(1))
This release requires a database upgrade. The easiest way to upgrade the database is with Ecto. Run mix ecto.gen.migration upgrade_rihanna_jobs
and make your migration look like this:
defmodule MyApp.UpgradeRihannaJobs do
use Rihanna.Migration.Upgrade
end
Now you can run mix ecto.migrate
.