projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Content-Disposition regex improvements
[akkoma]
/
lib
/
pleroma
/
jobs.ex
diff --git
a/lib/pleroma/jobs.ex
b/lib/pleroma/jobs.ex
index d42688193d8fbc1819980e9a1aa4d848a325d9ea..24b7e5e466261e86a9f1ba975cc1597007f43cf8 100644
(file)
--- a/
lib/pleroma/jobs.ex
+++ b/
lib/pleroma/jobs.ex
@@
-76,6
+76,7
@@
defmodule Pleroma.Jobs do
apply(mod, :perform, args)
end
else
apply(mod, :perform, args)
end
else
+ @spec enqueue(atom(), atom(), [any()], integer()) :: :ok
def enqueue(queue_name, mod, args, priority) do
GenServer.cast(__MODULE__, {:enqueue, queue_name, mod, args, priority})
end
def enqueue(queue_name, mod, args, priority) do
GenServer.cast(__MODULE__, {:enqueue, queue_name, mod, args, priority})
end
@@
-101,7
+102,11
@@
defmodule Pleroma.Jobs do
running_jobs = :sets.del_element(ref, running_jobs)
running_jobs = :sets.del_element(ref, running_jobs)
- state = state |> remove_ref(ref) |> maybe_start_job(queue_name, running_jobs, queue)
+ state =
+ state
+ |> remove_ref(ref)
+ |> update_queue(queue_name, {running_jobs, queue})
+ |> maybe_start_job(queue_name, running_jobs, queue)
{:noreply, state}
end
{:noreply, state}
end
@@
-117,7
+122,7
@@
defmodule Pleroma.Jobs do
|> add_ref(queue_name, mref)
|> update_queue(queue_name, {:sets.add_element(mref, running_jobs), queue})
else
|> add_ref(queue_name, mref)
|> update_queue(queue_name, {:sets.add_element(mref, running_jobs), queue})
else
- update_queue(state, queue_name, {running_jobs, queue})
+ state
end
end
end
end