reintroduce cutoff usage

This commit is contained in:
Dev Singh 2022-03-29 18:43:28 -05:00
parent 69c6059ff8
commit 8e5fa7eace
2 changed files with 3 additions and 4 deletions

View File

@ -9,7 +9,7 @@ def pull_new_tba_matches(apikey, competition, cutoff):
json = x.json() json = x.json()
out = [] out = []
for i in json: for i in json:
if i["actual_time"] != None and i["comp_level"] == "qm": if i["actual_time"] != None and i["comp_level"] == "qm" and i["actual_time"]-cutoff >= 0:
out.append({"match" : i['match_number'], "blue" : list(map(lambda x: int(x[3:]), i['alliances']['blue']['team_keys'])), "red" : list(map(lambda x: int(x[3:]), i['alliances']['red']['team_keys'])), "winner": i["winning_alliance"]}) out.append({"match" : i['match_number'], "blue" : list(map(lambda x: int(x[3:]), i['alliances']['blue']['team_keys'])), "red" : list(map(lambda x: int(x[3:]), i['alliances']['red']['team_keys'])), "winner": i["winning_alliance"]})
out.sort(key=lambda x: x['match']) out.sort(key=lambda x: x['match'])
return out return out

View File

@ -205,7 +205,6 @@ def main(logger, verbose, profile, debug, socket_send = None):
config.resolve_config_conflicts(logger, client) config.resolve_config_conflicts(logger, client)
config_modules, competition = config.modules, config.competition config_modules, competition = config.modules, config.competition
clear_metrics(client, config.competition)
for m in config_modules: for m in config_modules:
if m in modules: if m in modules:
start = time.time() start = time.time()