perf(retainer): do not GC on replicant nodes

This commit is contained in:
Andrew Mayorov 2023-08-03 15:34:24 +04:00
parent 42be694d40
commit 534a741b0e
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 8 additions and 0 deletions

View File

@ -153,6 +153,14 @@ store_retained(_, Msg = #message{topic = Topic}) ->
end.
clear_expired(_) ->
case mria_rlog:role() of
core ->
clear_expired();
_ ->
ok
end.
clear_expired() ->
NowMs = erlang:system_time(millisecond),
QH = qlc:q([
RetainedMsg