ecto_job v3.0.0 Release Notes

Release Date: 2019-10-24 // about 2 years ago
  • 🔖 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