Better today calculation, corrected schedule

This commit is contained in:
2022-06-03 08:19:18 -05:00
parent 1cc0eaa3ad
commit 1164e1e66c
3 changed files with 10 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ name: Last Pull for Yesterday
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
- cron: '0 10 * * *'
env:
TWITTER_TOKEN: ${{ secrets.TWITTER_TOKEN }}
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}

View File

@@ -2,7 +2,7 @@ name: Update Scores
on:
workflow_dispatch:
schedule:
- cron: '0 4,8,10,16,18 * * *'
- cron: '0 15,19,20,1,4 * * *'
env:
TWITTER_TOKEN: ${{ secrets.TWITTER_TOKEN }}
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}

View File

@@ -44,4 +44,11 @@ class WordleDay:
return self.wordle_no == other.wordle_no
WORDLE_TODAY = WordleDay.from_date(datetime.date.today())
# Designed so that "today" will be the current date in CST
# Regardless of where the code is run
today = (
datetime.datetime.now(datetime.timezone.utc)
.astimezone(datetime.timezone(datetime.timedelta(hours=-5), name="US Central"))
.date()
)
WORDLE_TODAY = WordleDay.from_date(today)