From e9c24090d493b6c43c7a331e91f239dd638e690d Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Tue, 28 May 2024 20:25:22 +0200 Subject: [PATCH] fix(cluster-link): avoid starting ps syncer if persistence disabled --- .../src/emqx_cluster_link_router_syncer.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/emqx_cluster_link/src/emqx_cluster_link_router_syncer.erl b/apps/emqx_cluster_link/src/emqx_cluster_link_router_syncer.erl index 9d35bb812..0cc27c328 100644 --- a/apps/emqx_cluster_link/src/emqx_cluster_link_router_syncer.erl +++ b/apps/emqx_cluster_link/src/emqx_cluster_link_router_syncer.erl @@ -241,10 +241,10 @@ init({sup, TargetCluster}) -> intensity => 10, period => 60 }, - Children = [ - child_spec(actor, TargetCluster), - child_spec(ps_actor, TargetCluster) - ], + Children = lists:append([ + [child_spec(actor, TargetCluster)], + [child_spec(ps_actor, TargetCluster) || emqx_persistent_message:is_persistence_enabled()] + ]), {ok, {SupFlags, Children}}; init({actor, State}) -> init_actor(State).