Zachary Loertscher
09/22/2023, 1:21 PMJake Kaplan
09/22/2023, 1:33 PMZachary Loertscher
09/22/2023, 2:29 PMGoshDarnedHero
09/22/2023, 9:22 PM@flow
def schedule_game_updates():
""" Every week go get the games, and add the jobs to the scheduler for each game """
logger = get_run_logger()
games: List[TGFPGame] = this_weeks_games()
jitter: int
for game in games:
jitter = randrange(1, 100)
start_date: datetime = game.pacific_start_time - timedelta(seconds=jitter)
log_msg: str = f"Adding game run flow: {game.tgfp_nfl_game_id} for time {start_date}"
<http://logger.info|logger.info>(log_msg)
run_deployment(
name="run-update-game/update-game-scores",
scheduled_time=start_date,
timeout=0,
parameters={"tgfp_nfl_game_id": game.tgfp_nfl_game_id},
flow_run_name=f"update-scores-game-{game.tgfp_nfl_game_id}"
)
GoshDarnedHero
09/22/2023, 9:24 PM