refactor(config): change global_gc_interval to ms
This commit is contained in:
parent
34382cacab
commit
048ba1e067
|
@ -87,7 +87,7 @@ code_change(_OldVsn, State, _Extra) ->
|
||||||
ensure_timer(State) ->
|
ensure_timer(State) ->
|
||||||
case emqx_config:get([node, global_gc_interval]) of
|
case emqx_config:get([node, global_gc_interval]) of
|
||||||
undefined -> State;
|
undefined -> State;
|
||||||
Interval -> TRef = emqx_misc:start_timer(timer:seconds(Interval), run),
|
Interval -> TRef = emqx_misc:start_timer(Interval, run),
|
||||||
State#{timer := TRef}
|
State#{timer := TRef}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
all() -> emqx_ct:all(?MODULE).
|
all() -> emqx_ct:all(?MODULE).
|
||||||
|
|
||||||
t_run_gc(_) ->
|
t_run_gc(_) ->
|
||||||
ok = emqx_config:put([node, global_gc_interval], 1),
|
ok = emqx_config:put([node, global_gc_interval], 1000),
|
||||||
{ok, _} = emqx_global_gc:start_link(),
|
{ok, _} = emqx_global_gc:start_link(),
|
||||||
ok = timer:sleep(1500),
|
ok = timer:sleep(1500),
|
||||||
{ok, MilliSecs} = emqx_global_gc:run(),
|
{ok, MilliSecs} = emqx_global_gc:run(),
|
||||||
|
|
Loading…
Reference in New Issue