File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 2828-include (" basho_bench.hrl" ).
2929
3030
31+ -define (AWAIT_TIMEOUT , 10000 ).
32+
33+
3134start () ->
3235 application :ensure_all_started (basho_bench ).
3336
@@ -414,13 +417,18 @@ await_nodes(NodeCount) ->
414417 await_nodes (NodeCount , 100 ).
415418
416419await_nodes (NodeCount , SleepMS ) ->
420+ await_nodes (NodeCount , SleepMS , ? AWAIT_TIMEOUT ).
421+
422+ await_nodes (_ , _ , Timeout ) when Timeout < 0 ->
423+ throw ({error , await_node_timeout });
424+ await_nodes (NodeCount , SleepMS , Timeout ) ->
417425 case NodeCount =:= length (nodes ()) + 1 of
418426 true ->
419427 ok ;
420428 false ->
421429 ? INFO (" Waiting on ~p nodes to connect~n " , [NodeCount - length (nodes ()) - 1 ]),
422430 timer :sleep (SleepMS ),
423- await_nodes (NodeCount , SleepMS * 2 )
431+ await_nodes (NodeCount , SleepMS * 2 , Timeout - SleepMS )
424432 end .
425433
426434bootstrap_bb () ->
You can’t perform that action at this time.
0 commit comments