Commit 6db52c3b authored by minibikini's avatar minibikini

Fix Oban warning

Warning example:

     [warn] Expected Elixir.Pleroma.Workers.BackgroundWorker.perform/2 to return :ok, {:ok, value}, or {:error, reason}. Instead received:  [error: "not found @user@server.party", error: "not found "]  The job will be considered a success.
parent e7771424
......@@ -35,7 +35,7 @@ def perform(
_job
) do
blocker = User.get_cached_by_id(blocker_id)
User.perform(:blocks_import, blocker, blocked_identifiers)
{:ok, User.perform(:blocks_import, blocker, blocked_identifiers)}
end
def perform(
......@@ -47,7 +47,7 @@ def perform(
_job
) do
follower = User.get_cached_by_id(follower_id)
User.perform(:follow_import, follower, followed_identifiers)
{:ok, User.perform(:follow_import, follower, followed_identifiers)}
end
def perform(%{"op" => "media_proxy_preload", "message" => message}, _job) do
......
......@@ -756,8 +756,8 @@ test "it imports user followings from list" do
]
{:ok, job} = User.follow_import(user1, identifiers)
result = ObanHelpers.perform(job)
assert {:ok, result} = ObanHelpers.perform(job)
assert is_list(result)
assert result == [user2, user3]
end
......@@ -979,8 +979,8 @@ test "it imports user blocks from list" do
]
{:ok, job} = User.blocks_import(user1, identifiers)
result = ObanHelpers.perform(job)
assert {:ok, result} = ObanHelpers.perform(job)
assert is_list(result)
assert result == [user2, user3]
end
......
......@@ -116,7 +116,7 @@ test "it imports follows with different nickname variations", %{conn: conn} do
|> json_response(:ok)
assert response == "job started"
assert [job_result] = ObanHelpers.perform_all()
assert [{:ok, job_result}] = ObanHelpers.perform_all()
assert job_result == [user2, user3, user4, user5, user6]
end
end
......@@ -180,7 +180,7 @@ test "it imports blocks with different nickname variations", %{conn: conn} do
|> json_response(:ok)
assert response == "job started"
assert [job_result] = ObanHelpers.perform_all()
assert [{:ok, job_result}] = ObanHelpers.perform_all()
assert job_result == [user2, user3, user4, user5, user6]
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment