Skip to content

Commit

Permalink
KAZOO-3313: distribute remaining fax jobs if the worker crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anderson committed Feb 10, 2015
1 parent 0e33eba commit d70f861
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions applications/fax/src/fax_jobs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ handle_info('timeout', #state{jobs=[]}=State) ->
lager:debug("failed to fetch fax jobs: ~p", [_Reason]),
{'noreply', State, ?POLLING_INTERVAL}
end;
handle_info({'DOWN', Ref, process, Pid, Reason}, State) ->
handle_info({'DOWN', Ref, process, Pid, Reason}, #state{jobs=Jobs}=State) ->
lager:debug("Fax Worker crashed ? ~p / ~p / ~p",[Ref, Pid, Reason]),
{'noreply', State, ?POLLING_INTERVAL};
{'noreply', State#state{jobs=distribute_jobs(Jobs)}, ?POLLING_INTERVAL};
handle_info(_Info, State) ->
lager:debug("unhandled message: ~p", [_Info]),
{'noreply', State, ?POLLING_INTERVAL}.
Expand Down Expand Up @@ -178,5 +178,3 @@ cleanup_jobs() ->
'ok';
{'error', _R} -> lager:debug("unable to cleanup jobs: ~p", [_R])
end.


0 comments on commit d70f861

Please sign in to comment.