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

Function get_queue_length

scripts/tournament_single_elim.py:49–61  ·  view source on GitHub ↗

Returns the length of the match queue.

(conn)

Source from the content-addressed store, hash-verified

47
48
49def get_queue_length(conn) -> int:
50 """
51 Returns the length of the match queue.
52 """
53 cur = conn.cursor()
54
55 query = 'SELECT COUNT(*) FROM {} WHERE \
56 status=\'queued\' or status=\'running\';'.format(TABLE_NAME)
57 cur.execute(query)
58 queue_length = cur.fetchone()[0]
59 cur.close()
60
61 return queue_length
62
63
64def get_tournament_maps(conn, tag=None) -> List[Map]:

Callers 1

wait_for_empty_queueFunction · 0.85

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected