Skip to content

Commit

Permalink
Always use the BasicEngine when draining queues
Browse files Browse the repository at this point in the history
  • Loading branch information
sorentwo committed Apr 2, 2021
1 parent ed952ae commit 3008fe1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/oban/queue/drainer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ defmodule Oban.Queue.Drainer do
@infinite 100_000_000

def drain(%Config{} = conf, [_ | _] = opts) do
conf = %{conf | engine: BasicEngine}

args =
opts
|> Keyword.put_new(:with_recursion, false)
Expand All @@ -30,8 +32,8 @@ defmodule Oban.Queue.Drainer do
end

defp fetch_available(conf, queue) do
{:ok, meta} = BasicEngine.init(conf, queue: queue, limit: @infinite)
{:ok, {_meta, jobs}} = BasicEngine.fetch_jobs(conf, meta, %{})
{:ok, meta} = conf.engine.init(conf, queue: queue, limit: @infinite)
{:ok, {_meta, jobs}} = conf.engine.fetch_jobs(conf, meta, %{})

jobs
end
Expand Down

0 comments on commit 3008fe1

Please sign in to comment.