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(_) ->
263
263
case khepri :start (? RA_SYSTEM , RaServerConfig ) of
264
264
{ok , ? STORE_ID } ->
265
265
wait_for_leader (),
266
- register_projections (),
266
+ wait_for_register_projections (),
267
267
? LOG_DEBUG (
268
268
" Khepri-based " ? RA_FRIENDLY_NAME " ready" ,
269
269
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
@@ -306,6 +306,21 @@ wait_for_leader(Timeout, Retries) ->
306
306
throw (Reason )
307
307
end .
308
308
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
+
309
324
% % @private
310
325
311
326
can_join_cluster (DiscoveryNode ) when is_atom (DiscoveryNode ) ->
You can’t perform that action at this time.
0 commit comments