Skip to content

Commit

Permalink
Have delays job run at more reasonable time
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Sep 23, 2024
1 parent 128e0f2 commit 96c467f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions ingestor/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ def update_time_predictions(event):
predictions.update_predictions()


# 7:45am UTC -> 2:45/3:45am ET every Monday
# There's no benefit to running it more frequently than once a week.
@app.schedule(Cron(45, 7, "?", "*", "MON", "*"))
def update_alert_delays(event):
today = datetime.now()
one_week_ago = (today - timedelta(days=8)).date()
delays.update_table(one_week_ago, today.date())


# 8:00am UTC -> 3:00/4:00am ET every day
@app.schedule(Cron(0, 8, "*", "*", "?", "*"))
def update_gtfs(event):
Expand All @@ -130,6 +121,15 @@ def update_trip_metrics(event):
trip_metrics.ingest_recent_trip_metrics(lookback_days=7)


# 11:45am UTC -> 6:45/7:45am ET every Monday
# There's no benefit to running it more frequently than once a week.
@app.schedule(Cron(45, 11, "?", "*", "MON", "*"))
def update_alert_delays(event):
today = datetime.now()
one_week_ago = (today - timedelta(days=8)).date()
delays.update_table(one_week_ago, today.date())


# Manually triggered lambda for populating daily trip metric tables. Only needs to be ran once.
@app.lambda_function()
def populate_delivered_trip_metrics(params, context):
Expand Down

0 comments on commit 96c467f

Please sign in to comment.