fix: fix auto_restart_interval checker
This commit is contained in:
parent
1f36726cab
commit
71b636e321
|
@ -66,7 +66,7 @@
|
||||||
start_after_created => boolean(),
|
start_after_created => boolean(),
|
||||||
%% If the resource disconnected, we can set to retry starting the resource
|
%% If the resource disconnected, we can set to retry starting the resource
|
||||||
%% periodically.
|
%% periodically.
|
||||||
auto_restart_interval => pos_integer(),
|
auto_restart_interval => pos_integer() | infinity,
|
||||||
batch_size => pos_integer(),
|
batch_size => pos_integer(),
|
||||||
batch_time => pos_integer(),
|
batch_time => pos_integer(),
|
||||||
max_buffer_bytes => pos_integer(),
|
max_buffer_bytes => pos_integer(),
|
||||||
|
|
|
@ -450,6 +450,8 @@ retry_actions(Data) ->
|
||||||
case maps:get(auto_restart_interval, Data#data.opts, ?AUTO_RESTART_INTERVAL) of
|
case maps:get(auto_restart_interval, Data#data.opts, ?AUTO_RESTART_INTERVAL) of
|
||||||
undefined ->
|
undefined ->
|
||||||
[];
|
[];
|
||||||
|
infinity ->
|
||||||
|
[];
|
||||||
RetryInterval ->
|
RetryInterval ->
|
||||||
[{state_timeout, RetryInterval, auto_retry}]
|
[{state_timeout, RetryInterval, auto_retry}]
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -124,6 +124,8 @@ auto_restart_interval(required) -> false;
|
||||||
auto_restart_interval(validator) -> fun auto_restart_interval_range/1;
|
auto_restart_interval(validator) -> fun auto_restart_interval_range/1;
|
||||||
auto_restart_interval(_) -> undefined.
|
auto_restart_interval(_) -> undefined.
|
||||||
|
|
||||||
|
auto_restart_interval_range(infinity) ->
|
||||||
|
ok;
|
||||||
auto_restart_interval_range(AutoRestartInterval) when
|
auto_restart_interval_range(AutoRestartInterval) when
|
||||||
is_integer(AutoRestartInterval) andalso
|
is_integer(AutoRestartInterval) andalso
|
||||||
AutoRestartInterval >= ?AUTO_RESTART_INTERVAL_RANGE_MIN andalso
|
AutoRestartInterval >= ?AUTO_RESTART_INTERVAL_RANGE_MIN andalso
|
||||||
|
|
Loading…
Reference in New Issue