Procházet zdrojové kódy

refactor(persistent_sessions): fix coding style

Tobias Lindahl před 4 roky
rodič
revize
89cd68d36f

+ 3 - 1
apps/emqx/src/emqx_cm.erl

@@ -58,6 +58,7 @@
         , lookup_channels/2
         ]).
 
+%% Test/debug interface
 -export([ all_channels/0
         , all_client_ids/0
         ]).
@@ -397,11 +398,12 @@ with_channel(ClientId, Fun) ->
         Pids  -> Fun(lists:last(Pids))
     end.
 
-%% @doc Get all channels registed.
+%% @doc Get all registed channel pids. Debugg/test interface
 all_channels() ->
     Pat = [{{'_', '$1'}, [], ['$1']}],
     ets:select(?CHAN_TAB, Pat).
 
+%% @doc Get all registed clientIDs. Debugg/test interface
 all_client_ids() ->
     Pat = [{{'$1', '_'}, [], ['$1']}],
     ets:select(?CHAN_TAB, Pat).

+ 3 - 2
apps/emqx/test/emqx_persistent_session_SUITE.erl

@@ -113,8 +113,9 @@ init_per_group(snabbkaffe, Config) ->
     [ {kill_connection_process, true} | Config];
 init_per_group(gc_tests, Config) ->
     %% We need to make sure the system does not interfere with this test group.
-    [maybe_kill_connection_process(ClientId, [{kill_connection_process, true}])
-     || ClientId <- emqx_cm:all_client_ids()],
+    lists:foreach(fun(ClientId) ->
+                          maybe_kill_connection_process(ClientId, [{kill_connection_process, true}])
+                  end, emqx_cm:all_client_ids()),
     emqx_common_test_helpers:stop_apps([]),
     SessionMsgEts = gc_tests_session_store,
     MsgEts = gc_tests_msg_store,