Changelog History
-
v3.1.0 Changes
September 16, 2020๐ Version 3.1.0 adds
- ๐ support for storing jobs in MySQL 8, thanks @jeanparpaillon !
- ๐ท persisting job params as an Elixir/Erlang term, thanks @lukyanov !
You can insert any arbitrary Elixir/Erlang term into the queue:
{"SendEmail", "[email protected]", "Welcome!"}|\> MyApp.JobQueue.new()|\> MyApp.Repo.insert()
You should use the option :params_type when defining your queue module:
defmodule MyJobQueue douse EctoJob.JobQueue, table\_name: "jobs", params\_type: :binary# ...end
0๏ธโฃ Possible values of the option are: :map (default) and :binary (for storing Elixir/Erlang terms).
You should use the same option when setting up the migration:
@ecto\_job\_version 3def up doEctoJob.Migrations.Install.up() EctoJob.Migrations.up("jobs", version: @ecto\_job\_version, params\_type: :binary)end
-
v3.0.0 Changes
October 24, 2019๐ Version 3.0 adds support for prioritizing jobs within each job queue. ๐ท The
priority
option can be given when creating a Job:%{"type" => "SendEmail", "address" => "[email protected]", "body" => "Welcome!"} |> MyApp.JobQueue.new(priority: 2, max_attempts: 2) |> MyApp.Repo.insert()
0๏ธโฃ Lower numbers run first, the default value is 0.
Thanks to ramondelemos for contibuting this feature!
๐ท #45 - gabriel128 Failed jobs will retry before the full
execution_timeout
when an error occurs. By default the first retry will occur 30 seconds after failure.Thanks to gabriel128 for contributing this feature!
Migrating to 3.0
โก๏ธ To upgrade to version 3.0 you must add a migration to update the pre-existent job queue tables:
mix ecto.gen.migration update_job_queue
defmodule MyApp.Repo.Migrations.UpdateJobQueue do use Ecto.Migration @ecto_job_version 3 def up do EctoJob.Migrations.UpdateJobTable.up(@ecto_job_version, "jobs") end def down do EctoJob.Migrations.UpdateJobTable.down(@ecto_job_version, "jobs") end end
-
v2.1.0 Changes
May 16, 2019๐ Version 2.1 add support for requeing jobs, fixes to the job reservation algorithm and dialyzer warnings.
๐ท #34 - mkorszun New API to requeue a failed job :
Requeuing will:
- โฑ set
state
toSCHEDULED
- set
attempt
to0
- set
expires
tonil
Ecto.Multi.new() |> MyApp.Job.requeue("requeue_job", failed_job) |> MyApp.Repo.transaction()
โก๏ธ #43 - mbuhot, seangeo - Fixed issue where too many rows would be locked, causing negative demand in GenStage producer. See this document for additional details.
โ #41 - mbuhot - Fixed dialyzer warnings in
JobQueue
modules๐ #42 - sneako - Improved documentation
๐ #48 - darksheik - Improved documentation
Thankyou contributors!
- โฑ set
-
v2.0.0 Changes
January 20, 2019๐ท EctoJob 2.0 adds support for Ecto 3.0.
There should be no breaking changes other than the dependency on
ecto_sql ~> 3.0
.๐ท #31 - mbuhot - Timestamp options on job tables can be customized.
๐ท #30 - mbuhot - Job tables can be declared with custom
schema_prefix
.0๏ธโฃ #29 - mbuhot - EctoJob will always use a
:bigserial
primary key instead of relying on theecto
default. -
v1.0.0 Changes
October 04, 2018๐ท #24 - mbuhot - EctoJob will work in a polling fashion when
Postgrex.Notifications
is not working reliably. ๐ See https://github.com/elixir-ecto/postgrex/issues/375 for some background.๐ง #23 - enzoqtvf - Add a configuration option
notifications_listen_timeout
for timeout for call toPostgrex.Notifications.listen!/3
-
v0.3.0 Changes
June 02, 2018๐ง #17 - mmartinson - Make base expiry configurable
โฑ Adds configuration options for
execution_timeout
andreservation_timeout
. -
v0.2.1 Changes
March 29, 2018 -
v0.2.0 Changes
March 28, 2018 -
v0.1.1 Changes
February 15, 2018 -
v0.1 Changes
๐ Initial Release to Hex.pm