fix: Fix cleanup interval options

This commit is contained in:
Yaroslav Rogov 2021-06-22 15:39:55 +03:00
parent 8a224b81f8
commit b3b5c30828
No known key found for this signature in database
GPG Key ID: 5159F2A85653816B
2 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
]},
{cache_update_interval, 5000}, % milliseconds
{cache_update_pull_limit, 10}, % event batch size
{cache_cleanup_interval, 5000}, % milliseconds
{max_cache_size, #{
elements => 20,
memory => 52428800 % 50Mb

View File

@ -481,7 +481,7 @@ restart_update_timer(State = #state{update_timer = TimerRef}) ->
-spec restart_cleanup_timer(state()) -> state().
restart_cleanup_timer(State = #state{cleanup_timer = TimerRef}) ->
cancel_timer(TimerRef),
Interval = genlib_app:env(dmt_client, cache_update_interval, ?DEFAULT_CLEANUP_INTERVAL),
Interval = genlib_app:env(dmt_client, cache_cleanup_interval, ?DEFAULT_CLEANUP_INTERVAL),
State#state{cleanup_timer = erlang:send_after(Interval, self(), {cleanup_timer, timeout})}.
cancel_timer(undefined) ->