Skip to content

Commit

Permalink
Remove SKIP LOCKED from dolphin cancel_all_jobs
Browse files Browse the repository at this point in the history
The use of `SKIP LOCKED` isn't necessary. Unlike job fetching, there's
little chance two separate nodes are bulk-cancelling the same jobs, and
if they did, the worst case is that the `cancelled_at` time is updated.

Closes #1222
  • Loading branch information
sorentwo committed Jan 11, 2025
1 parent fb22494 commit c36c7fe
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/oban/engines/dolphin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ defmodule Oban.Engines.Dolphin do
queryable
|> where([j], j.state not in ~w(cancelled completed discarded))
|> select([j], map(j, [:id, :queue, :state]))
|> lock("FOR UPDATE SKIP LOCKED")
|> then(&Repo.all(conf, &1))

query = where(Job, [j], j.id in ^Enum.map(jobs, & &1.id))
Expand Down

0 comments on commit c36c7fe

Please sign in to comment.