chore: export function

This commit is contained in:
Turtle 2021-06-04 01:01:42 +08:00 committed by turtleDeng
parent eeb480c051
commit e10e241fe9
2 changed files with 18 additions and 1 deletions

View File

@ -79,6 +79,9 @@
{load_module, emqx_trie, soft_purge, soft_purge, []},
{load_module, emqx_router, soft_purge, soft_purge, [emqx_trie]}
]},
{<<"4.2.6">>, [
{load_module, emqx_channel, brutal_purge, soft_purge, []}
]},
{<<".*">>, []}
],
[
@ -159,6 +162,9 @@
{load_module, emqx_trie, soft_purge, soft_purge, [emqx_router]},
{load_module, emqx_router, soft_purge, soft_purge, []}
]},
{<<"4.2.6">>, [
{load_module, emqx_channel, brutal_purge, soft_purge, []}
]},
{<<".*">>, []}
]
}.

View File

@ -49,7 +49,10 @@
]).
%% Export for emqx_sn
-export([do_deliver/2]).
-export([ do_deliver/2
, ensure_keepalive/2
, clear_keepalive/1
]).
%% Exports for CT
-export([set_field/3]).
@ -1512,6 +1515,14 @@ ensure_keepalive_timer(Interval, Channel = #channel{clientinfo = #{zone := Zone}
Keepalive = emqx_keepalive:init(round(timer:seconds(Interval) * Backoff)),
ensure_timer(alive_timer, Channel#channel{keepalive = Keepalive}).
clear_keepalive(Channel = #channel{timers = Timers}) ->
case maps:get(alive_timer, Timers, undefined) of
undefined ->
Channel;
TRef ->
emqx_misc:cancel_timer(TRef),
Channel#channel{timers = maps:without([alive_timer], Timers)}
end.
%%--------------------------------------------------------------------
%% Maybe Resume Session