refactor: reduce arity
This commit is contained in:
parent
021755b82b
commit
c74abe79d0
|
@ -301,9 +301,8 @@ open_session(false, ClientInfo = #{clientid := ClientId}, ConnInfo) ->
|
|||
emqx_cm_locker:trans(ClientId, ResumeStart).
|
||||
|
||||
create_session(ClientInfo, ConnInfo) ->
|
||||
#{clientid := ClientId} = ClientInfo,
|
||||
Options = get_session_confs(ClientInfo, ConnInfo),
|
||||
Session = emqx_session:init_and_open(ClientId, Options),
|
||||
Session = emqx_session:init_and_open(Options),
|
||||
ok = emqx_metrics:inc('session.created'),
|
||||
ok = emqx_hooks:run('session.created', [ClientInfo, emqx_session:info(Session)]),
|
||||
Session.
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
unpersist/1
|
||||
]).
|
||||
|
||||
-export([init/1, init_and_open/2]).
|
||||
-export([init/1, init_and_open/1]).
|
||||
|
||||
-export([
|
||||
info/1,
|
||||
|
@ -166,8 +166,9 @@
|
|||
%% Init a Session
|
||||
%%--------------------------------------------------------------------
|
||||
|
||||
-spec init_and_open(emqx_types:clientid(), options()) -> session().
|
||||
init_and_open(ClientID, Options) ->
|
||||
-spec init_and_open(options()) -> session().
|
||||
init_and_open(Options) ->
|
||||
#{clientid := ClientID} = Options,
|
||||
Session0 = emqx_session:init(Options),
|
||||
_ = emqx_persistent_session_ds:open_session(ClientID),
|
||||
Session0.
|
||||
|
|
Loading…
Reference in New Issue