MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / wait_for_empty_queue

Function wait_for_empty_queue

scripts/tournament_single_elim.py:183–194  ·  view source on GitHub ↗

Checks every 10 seconds until the queue is empty. This method is used to ensure that rankings are final after we recalculate them.

(conn)

Source from the content-addressed store, hash-verified

181
182
183def wait_for_empty_queue(conn) -> None:
184 """
185 Checks every 10 seconds until the queue is empty. This method is used to
186 ensure that rankings are final after we recalculate them.
187 """
188 queue_length = get_queue_length(conn)
189 while queue_length != 0:
190 time.sleep(10)
191 logging.info('Waiting for the queue to empty: {} left...'
192 .format(queue_length))
193 queue_length = get_queue_length(conn)
194 logging.debug('Queue is empty.')
195
196
197def pad_teams_power_of_two(teams: List[Team]) -> List[Team]:

Callers 1

run_tournamentFunction · 0.85

Calls 3

get_queue_lengthFunction · 0.85
formatMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected