tiny improve
authorEgor Kislitsyn <egor@kislitsyn.com>
Wed, 30 Jan 2019 15:56:59 +0000 (22:56 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Wed, 30 Jan 2019 15:56:59 +0000 (22:56 +0700)
lib/pleroma/jobs.ex

index 16dccb6824c6da512c638ab7c234a31b5e129c5c..24b7e5e466261e86a9f1ba975cc1597007f43cf8 100644 (file)
@@ -102,7 +102,11 @@ defmodule Pleroma.Jobs do
 
     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
@@ -118,7 +122,7 @@ defmodule Pleroma.Jobs do
       |> 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