Compare commits
1 Commits
master
...
uw-reset-w
Author | SHA1 | Date | |
---|---|---|---|
![]() |
672f2f75c9 |
@ -1,6 +1,6 @@
|
|||||||
{application,gmhive_client,
|
{application,gmhive_client,
|
||||||
[{description,"Gajumaru Hive Client"},
|
[{description,"Gajumaru Hive Client"},
|
||||||
{vsn,"0.4.3"},
|
{vsn,"0.4.4"},
|
||||||
{registered,[]},
|
{registered,[]},
|
||||||
{applications,[kernel,stdlib,sasl,gproc,inets,ssl,enoise,
|
{applications,[kernel,stdlib,sasl,gproc,inets,ssl,enoise,
|
||||||
gmconfig,gmhive_protocol,gmhive_worker]},
|
gmconfig,gmhive_protocol,gmhive_worker]},
|
||||||
|
@ -272,13 +272,14 @@ incr_worker_error(#worker{errors = Es, index = I} = W, Ws) ->
|
|||||||
W1 = reset_worker_(W#worker{errors = Es+1}),
|
W1 = reset_worker_(W#worker{errors = Es+1}),
|
||||||
lists:keyreplace(I, #worker.index, Ws, W1).
|
lists:keyreplace(I, #worker.index, Ws, W1).
|
||||||
|
|
||||||
maybe_continue(stopped, _, S) ->
|
%% maybe_continue(stopped, _, S) ->
|
||||||
S;
|
%% S;
|
||||||
maybe_continue(continue, W, S) ->
|
maybe_continue(continue, W, S) ->
|
||||||
maybe_restart_worker(W, S);
|
maybe_restart_worker(W, S);
|
||||||
maybe_continue(error, W, S) ->
|
maybe_continue(error, W, S) ->
|
||||||
?LOG_INFO("Won't restart worker ~p due to error", [W#worker.index]),
|
?LOG_INFO("Won't restart worker ~p due to error", [W#worker.index]),
|
||||||
S.
|
Ws = reset_worker(W, S#st.workers),
|
||||||
|
S#st{workers = Ws}.
|
||||||
|
|
||||||
maybe_restart_worker(#worker{index = I} = W, #st{candidate = C} = S) ->
|
maybe_restart_worker(#worker{index = I} = W, #st{candidate = C} = S) ->
|
||||||
case maps:get(nonces, C) of
|
case maps:get(nonces, C) of
|
||||||
@ -314,7 +315,7 @@ stop_workers_for_seq(Seq, Workers) ->
|
|||||||
stop_worker(#worker{pid = Pid} = W) when is_pid(Pid) ->
|
stop_worker(#worker{pid = Pid} = W) when is_pid(Pid) ->
|
||||||
MRef = erlang:monitor(process, Pid),
|
MRef = erlang:monitor(process, Pid),
|
||||||
?LOG_DEBUG("Will stop worker ~p (MRef = ~p)", [Pid, MRef]),
|
?LOG_DEBUG("Will stop worker ~p (MRef = ~p)", [Pid, MRef]),
|
||||||
exit(Pid, kill),
|
exit(Pid, shutdown),
|
||||||
receive
|
receive
|
||||||
{'EXIT', Pid, _} -> ok;
|
{'EXIT', Pid, _} -> ok;
|
||||||
{'DOWN', MRef, process, Pid, _} -> ok
|
{'DOWN', MRef, process, Pid, _} -> ok
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
{type,app}.
|
{type,app}.
|
||||||
{modules,[]}.
|
{modules,[]}.
|
||||||
{prefix,"gmhc"}.
|
{prefix,"gmhc"}.
|
||||||
{author,"Ulf Wiger, QPQ AG"}.
|
|
||||||
{desc,"Gajumaru Hive Client"}.
|
{desc,"Gajumaru Hive Client"}.
|
||||||
{package_id,{"uwiger","gmhive_client",{0,4,3}}}.
|
{author,"Ulf Wiger, QPQ AG"}.
|
||||||
|
{package_id,{"uwiger","gmhive_client",{0,4,4}}}.
|
||||||
{deps,[{"uwiger","gmcuckoo",{1,2,3}},
|
{deps,[{"uwiger","gmcuckoo",{1,2,3}},
|
||||||
{"uwiger","gmhive_worker",{0,3,0}},
|
{"uwiger","gmhive_worker",{0,3,0}},
|
||||||
{"otpr","eblake2",{1,0,1}},
|
{"otpr","eblake2",{1,0,1}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user