refactor(config): change global_gc_interval to ms

This commit is contained in:
Shawn 2021-07-23 11:14:08 +08:00
parent 34382cacab
commit 048ba1e067
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ code_change(_OldVsn, State, _Extra) ->
ensure_timer(State) ->
case emqx_config:get([node, global_gc_interval]) of
undefined -> State;
Interval -> TRef = emqx_misc:start_timer(timer:seconds(Interval), run),
Interval -> TRef = emqx_misc:start_timer(Interval, run),
State#{timer := TRef}
end.

View File

@ -24,7 +24,7 @@
all() -> emqx_ct:all(?MODULE).
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 = timer:sleep(1500),
{ok, MilliSecs} = emqx_global_gc:run(),