Add 'stability_time' env var for repair
This commit is contained in:
parent
a3fbe2c8bb
commit
f433e84fab
1 changed files with 2 additions and 1 deletions
|
@ -2569,12 +2569,13 @@ perhaps_start_repair(#ch_mgr{name=MyName,
|
||||||
%% RepairOpts = [{repair_mode, check}, verbose],
|
%% RepairOpts = [{repair_mode, check}, verbose],
|
||||||
RepairFun = fun() -> do_repair(S, RepairOpts, CMode) end,
|
RepairFun = fun() -> do_repair(S, RepairOpts, CMode) end,
|
||||||
LastUPI = lists:last(UPI),
|
LastUPI = lists:last(UPI),
|
||||||
|
StabilityTime = application:get_env(machi, stability_time, ?REPAIR_START_STABILITY_TIME),
|
||||||
IgnoreStabilityTime_p = proplists:get_value(ignore_stability_time,
|
IgnoreStabilityTime_p = proplists:get_value(ignore_stability_time,
|
||||||
S#ch_mgr.opts, false),
|
S#ch_mgr.opts, false),
|
||||||
case timer:now_diff(os:timestamp(), Start) div 1000000 of
|
case timer:now_diff(os:timestamp(), Start) div 1000000 of
|
||||||
N when MyName == LastUPI andalso
|
N when MyName == LastUPI andalso
|
||||||
(IgnoreStabilityTime_p orelse
|
(IgnoreStabilityTime_p orelse
|
||||||
N >= ?REPAIR_START_STABILITY_TIME) ->
|
N >= StabilityTime) ->
|
||||||
{WorkerPid, _Ref} = spawn_monitor(RepairFun),
|
{WorkerPid, _Ref} = spawn_monitor(RepairFun),
|
||||||
S#ch_mgr{repair_worker=WorkerPid,
|
S#ch_mgr{repair_worker=WorkerPid,
|
||||||
repair_start=os:timestamp(),
|
repair_start=os:timestamp(),
|
||||||
|
|
Loading…
Reference in a new issue