Skip to content

Commit

Permalink
better timing for emails
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Morris committed Oct 3, 2024
1 parent da2c1f3 commit 212390b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/hourly-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Hourly test
on:
schedule:
- cron: "58 0-9,11-23 * * *" # hourly, except at 12:00 UTC (07:00 EST)
- cron: "55 0-9,11-23 * * *" # hourly, except at 12:00 UTC (07:00 EST)

jobs:
run_tests:
Expand All @@ -22,5 +22,5 @@ jobs:
- name: Curate a poem, and send it to the testserv
run:
python scripts/send-poem.py --mode "test" --username "poemsfromtom@gmail.com" --password ${{ secrets.PFT_PW }} --listserv_filename "poems/testserv.csv"
python scripts/send-poem.py --mode "hourly-test" --username "poemsfromtom@gmail.com" --password ${{ secrets.PFT_PW }} --listserv_filename "poems/testserv.csv"
--github_repo_name "thomaswmorris.github.io" --github_token ${{ secrets.GH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
- name: Send poem to myself
run:
python scripts/send-poem.py --mode "test" --username "poemsfromtom@gmail.com" --password ${{ secrets.PFT_PW }} --listserv_filename "poems/testserv.csv"
python scripts/send-poem.py --mode "test-on-push" --username "poemsfromtom@gmail.com" --password ${{ secrets.PFT_PW }} --listserv_filename "poems/testserv.csv"
--github_repo_name "thomaswmorris.github.io" --github_token ${{ secrets.GH_TOKEN }} --write_to_repo
4 changes: 2 additions & 2 deletions scripts/send-poem.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

delta = datetime.timedelta(hours=1)
now = datetime.datetime.now()
if args.mode == "daily":
if args.mode in ["daily", "hourly-test"]:
start_time = (now + datetime.timedelta(hours=1)).replace(microsecond=0, second=0, minute=0)
else:
start_time = (now + datetime.timedelta(minutes=1)).replace(microsecond=0, second=0)
Expand All @@ -65,7 +65,7 @@
for index, entry in listserv.iterrows():
t = threading.Thread(target=utils.email_thread, kwargs={**thread_kwargs, "recipient": entry.email})
t.start()
ttime.sleep(1e-1)
ttime.sleep(5e-1)

if args.write_to_repo:

Expand Down

0 comments on commit 212390b

Please sign in to comment.