feat(sessds): Make stream renew interval configurable
This commit is contained in:
parent
c43b3eb535
commit
371ec34992
|
@ -429,7 +429,8 @@ handle_timeout(
|
||||||
{ok, Publishes, Session};
|
{ok, Publishes, Session};
|
||||||
handle_timeout(_ClientInfo, ?TIMER_GET_STREAMS, Session) ->
|
handle_timeout(_ClientInfo, ?TIMER_GET_STREAMS, Session) ->
|
||||||
renew_streams(Session),
|
renew_streams(Session),
|
||||||
{ok, [], emqx_session:ensure_timer(?TIMER_GET_STREAMS, 100, Session)};
|
Interval = emqx_config:get([session_persistence, renew_streams_interval]),
|
||||||
|
{ok, [], emqx_session:ensure_timer(?TIMER_GET_STREAMS, Interval, Session)};
|
||||||
handle_timeout(_ClientInfo, ?TIMER_BUMP_LAST_ALIVE_AT, Session0) ->
|
handle_timeout(_ClientInfo, ?TIMER_BUMP_LAST_ALIVE_AT, Session0) ->
|
||||||
%% Note: we take a pessimistic approach here and assume that the client will be alive
|
%% Note: we take a pessimistic approach here and assume that the client will be alive
|
||||||
%% until the next bump timeout. With this, we avoid garbage collecting this session
|
%% until the next bump timeout. With this, we avoid garbage collecting this session
|
||||||
|
|
|
@ -1805,6 +1805,14 @@ fields("session_persistence") ->
|
||||||
desc => ?DESC(session_ds_last_alive_update_interval)
|
desc => ?DESC(session_ds_last_alive_update_interval)
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
|
{"renew_streams_interval",
|
||||||
|
sc(
|
||||||
|
timeout_duration(),
|
||||||
|
#{
|
||||||
|
default => <<"5000ms">>,
|
||||||
|
importance => ?IMPORTANCE_HIDDEN
|
||||||
|
}
|
||||||
|
)},
|
||||||
{"session_gc_interval",
|
{"session_gc_interval",
|
||||||
sc(
|
sc(
|
||||||
timeout_duration(),
|
timeout_duration(),
|
||||||
|
|
Loading…
Reference in New Issue