X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fsupport%2Foban_helpers.ex;h=9b6e5256e54ca7f981a15a240f0c6b0971a06375;hb=85d71d4f1d433a168eb136ad88b651b6c1d1a4fc;hp=0e3b654df304fad1632d0a4a808951ceea17978c;hpb=61d9f43e463a3b3b0c1e4b9c98c22e222797bd82;p=akkoma
diff --git a/test/support/oban_helpers.ex b/test/support/oban_helpers.ex
index 0e3b654df..9b6e5256e 100644
--- a/test/support/oban_helpers.ex
+++ b/test/support/oban_helpers.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Tests.ObanHelpers do
@@ -7,6 +7,8 @@ defmodule Pleroma.Tests.ObanHelpers do
Oban test helpers.
"""
+ require Ecto.Query
+
alias Pleroma.Repo
def wipe_all do
@@ -15,12 +17,13 @@ defmodule Pleroma.Tests.ObanHelpers do
def perform_all do
Oban.Job
+ |> Ecto.Query.where(state: "available")
|> Repo.all()
|> perform()
end
def perform(%Oban.Job{} = job) do
- res = apply(String.to_existing_atom("Elixir." <> job.worker), :perform, [job.args, job])
+ res = apply(String.to_existing_atom("Elixir." <> job.worker), :perform, [job])
Repo.delete(job)
res
end