retained messages
This commit is contained in:
parent
c803ce0d7a
commit
f16d56c8b9
|
@ -71,7 +71,9 @@ retain(Msg = #mqtt_message{retain = true}) ->
|
|||
|
||||
%%
|
||||
subscribe(Topics, CPid) when is_pid(CPid) ->
|
||||
lager:info("Retained Topics: ~p", [match(Topics)]),
|
||||
RetainedMsgs = lists:flatten([mnesia:dirty_read(?RETAINED_TAB, Topic) || Topic <- match(Topics)]),
|
||||
lager:info("Retained Messages: ~p", [RetainedMsgs]),
|
||||
lists:foreach(fun(Msg) ->
|
||||
CPid ! {dispatch, {self(), retained_msg(Msg)}}
|
||||
end, RetainedMsgs).
|
||||
|
|
Loading…
Reference in New Issue