File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ setup(_) ->
263263 case khepri :start (? RA_SYSTEM , RaServerConfig ) of
264264 {ok , ? STORE_ID } ->
265265 wait_for_leader (),
266- register_projections (),
266+ wait_for_register_projections (),
267267 ? LOG_DEBUG (
268268 " Khepri-based " ? RA_FRIENDLY_NAME " ready" ,
269269 #{domain => ? RMQLOG_DOMAIN_GLOBAL }),
@@ -306,6 +306,21 @@ wait_for_leader(Timeout, Retries) ->
306306 throw (Reason )
307307 end .
308308
309+ wait_for_register_projections () ->
310+ wait_for_register_projections (retry_timeout (), retry_limit ()).
311+
312+ wait_for_register_projections (_Timeout , 0 ) ->
313+ exit (timeout_waiting_for_khepri_projections );
314+ wait_for_register_projections (Timeout , Retries ) ->
315+ rabbit_log :info (" Waiting for Khepri projections for ~tp ms, ~tp retries left" ,
316+ [Timeout , Retries - 1 ]),
317+ try
318+ register_projections ()
319+ catch
320+ throw : {timeout , _ServerId } ->
321+ wait_for_register_projections (Timeout , Retries - 1 )
322+ end .
323+
309324% % @private
310325
311326can_join_cluster (DiscoveryNode ) when is_atom (DiscoveryNode ) ->
You can’t perform that action at this time.
0 commit comments