Skip to content

Commit d173011

Browse files
committed
Restore zero arity version of pause_all_queues/0
Both pause and resume variants lost their default argument in a refactor that shifted around guard clauses.
1 parent b66ee14 commit d173011

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/oban.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ defmodule Oban do
921921
end
922922

923923
@doc false
924+
def pause_all_queues(name \\ Oban)
924925
def pause_all_queues(opts) when is_list(opts), do: pause_all_queues(__MODULE__, opts)
925926
def pause_all_queues(name), do: pause_all_queues(name, [])
926927

@@ -995,6 +996,7 @@ defmodule Oban do
995996
end
996997

997998
@doc false
999+
def resume_all_queues(name \\ Oban)
9981000
def resume_all_queues(opts) when is_list(opts), do: resume_all_queues(__MODULE__, opts)
9991001
def resume_all_queues(name), do: resume_all_queues(name, [])
10001002

test/support/exercise.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,17 @@ defmodule Oban.Test.Exercise do
4444
%Multi{} = Oban.insert_all(Oban, Multi.new(), :job, [changeset], timeout: 500)
4545
end
4646

47+
def check_pause_resume_all do
48+
Oban.pause_all_queues()
49+
Oban.pause_all_queues(Oban)
50+
Oban.pause_all_queues(Oban, local_only: true)
51+
Oban.pause_all_queues(local_only: true)
52+
53+
Oban.resume_all_queues()
54+
Oban.resume_all_queues(Oban)
55+
Oban.resume_all_queues(Oban, local_only: true)
56+
Oban.resume_all_queues(local_only: true)
57+
end
58+
4759
defp changeset, do: Job.new(%{}, worker: "FakeWorker")
4860
end

0 commit comments

Comments
 (0)