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 @@ -252,7 +252,7 @@ setup(_) ->
252
252
case khepri :start (? RA_SYSTEM , RaServerConfig ) of
253
253
{ok , ? STORE_ID } ->
254
254
wait_for_leader (),
255
- register_projections (),
255
+ wait_for_register_projections (),
256
256
? LOG_DEBUG (
257
257
" Khepri-based " ? RA_FRIENDLY_NAME " ready" ,
258
258
#{domain => ? RMQLOG_DOMAIN_GLOBAL }),
@@ -295,6 +295,21 @@ wait_for_leader(Timeout, Retries) ->
295
295
throw (Reason )
296
296
end .
297
297
298
+ wait_for_register_projections () ->
299
+ wait_for_register_projections (retry_timeout (), retry_limit ()).
300
+
301
+ wait_for_register_projections (_Timeout , 0 ) ->
302
+ exit (timeout_waiting_for_khepri_projections );
303
+ wait_for_register_projections (Timeout , Retries ) ->
304
+ rabbit_log :info (" Waiting for Khepri projections for ~tp ms, ~tp retries left" ,
305
+ [Timeout , Retries - 1 ]),
306
+ try
307
+ register_projections ()
308
+ catch
309
+ throw : {timeout , _ServerId } ->
310
+ wait_for_register_projections (Timeout , Retries - 1 )
311
+ end .
312
+
298
313
% % @private
299
314
300
315
can_join_cluster (DiscoveryNode ) when is_atom (DiscoveryNode ) ->
You can’t perform that action at this time.
0 commit comments