Skip to content

Commit

Permalink
Merge pull request #20 from esl/dont_stop
Browse files Browse the repository at this point in the history
[change] don't stop consumer process if there is an error running a job
  • Loading branch information
filipevarjao authored Nov 30, 2018
2 parents d5e03f7 + a688fa0 commit 015433c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/repo_jobs/lib/repo_jobs/consumer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,12 @@ defmodule RepoJobs.Consumer do
:ok = client.reject(channel, delivery_tag, requeue: true)
if caller, do: send(caller, {:reject, error})
end

{:noreply, state}
rescue
exception ->
:ok = client.reject(channel, delivery_tag, requeue: true)
if caller, do: send(caller, {:reject, exception})
{:stop, exception, state}
after
{:noreply, state}
end
end

Expand Down

0 comments on commit 015433c

Please sign in to comment.