projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CHANGELOG: Support `poll` notification type
[akkoma]
/
test
/
support
/
oban_helpers.ex
diff --git
a/test/support/oban_helpers.ex
b/test/support/oban_helpers.ex
index 72792c0648a89a7f5d9a8df2199dfe74665cf4c5..9b6e5256e54ca7f981a15a240f0c6b0971a06375 100644
(file)
--- a/
test/support/oban_helpers.ex
+++ b/
test/support/oban_helpers.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
21
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Tests.ObanHelpers do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Tests.ObanHelpers do
@@
-7,16
+7,23
@@
defmodule Pleroma.Tests.ObanHelpers do
Oban test helpers.
"""
Oban test helpers.
"""
+ require Ecto.Query
+
alias Pleroma.Repo
alias Pleroma.Repo
+ def wipe_all do
+ Repo.delete_all(Oban.Job)
+ end
+
def perform_all do
Oban.Job
def perform_all do
Oban.Job
+ |> Ecto.Query.where(state: "available")
|> Repo.all()
|> perform()
end
def perform(%Oban.Job{} = job) do
|> 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
Repo.delete(job)
res
end