Skip to content

Commit

Permalink
Make sure weekly runs happen
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Sep 4, 2024
1 parent 7ff1e5f commit d896e18
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
21 changes: 21 additions & 0 deletions ingestor/.chalice/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,27 @@
}
}
},
"UpdateAlertDelays": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Environment": {
"Variables": {
"DD_API_KEY": {
"Ref": "DDApiKey"
},
"DD_VERSION": {
"Ref": "GitVersion"
},
"DD_TAGS": {
"Ref": "DDTags"
},
"DD_GIT_REPOSITORY_URL": {
"Ref": "DDGitRepositoryUrl"
}
}
}
}
},
"UpdateDeliveredTripMetricsYesterday": {
"Type": "AWS::Serverless::Function",
"Properties": {
Expand Down
3 changes: 2 additions & 1 deletion ingestor/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def update_time_predictions(event):


# 7:45am UTC -> 2:45/3:45am ET every Monday
@app.schedule(Cron(45, 7, "*", "*", "1", "*"))
# 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()
Expand Down
6 changes: 3 additions & 3 deletions ingestor/chalicelib/delays/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import pandas as pd
import requests

from ingestor.chalicelib import constants, dynamo
from ingestor.chalicelib.delays.aggregate import group_weekly_data
from ingestor.chalicelib.delays.types import Alert, AlertsRequest
from chalicelib import constants, dynamo
from chalicelib.delays.aggregate import group_weekly_data
from chalicelib.delays.types import Alert, AlertsRequest

TABLE_NAME = "AlertDelaysWeekly"

Expand Down

0 comments on commit d896e18

Please sign in to comment.