We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2249213 commit e98e36eCopy full SHA for e98e36e
lib/exq/node/server.ex
@@ -103,19 +103,16 @@ defmodule Exq.Node.Server do
103
104
case Process.info(worker_pid, :links) do
105
{:links, links} when length(links) <= 10 ->
106
- job_pid =
107
- Enum.find(links, fn link ->
108
- match?(%Job{jid: ^jid}, Metadata.lookup(state.metadata, link))
109
- end)
110
-
111
- if job_pid do
+ if Enum.any?(links, fn link ->
+ match?(%Job{jid: ^jid}, Metadata.lookup(state.metadata, link))
+ end) do
112
Server.cancel(worker_pid)
113
Logger.info("Canceled jid #{jid}")
114
else
115
Logger.warning("Not able to find worker process to cancel")
116
end
117
118
- nil ->
+ _ ->
119
120
121
0 commit comments