Skip to content

Commit

Permalink
Provide UTC as default scheduler timezone.
Browse files Browse the repository at this point in the history
This should stop the "/usr/local/lib/python3.11/site-packages/tzlocal/unix.py:158: UserWarning: Can not find any timezone configuration, defaulting to UTC.
warnings.warn('Can not find any timezone configuration, defaulting to UTC.')" warning
  • Loading branch information
dwrss committed Sep 13, 2023
1 parent de83c38 commit f0600ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import json
import logging.config
import asyncio

import pytz
from apscheduler.schedulers.asyncio import AsyncIOScheduler

from botto.clients import ClickUpClient, AppStoreConnectClient
Expand Down Expand Up @@ -34,7 +36,7 @@

log.info(f"Triggers: {config['triggers']}")

scheduler = AsyncIOScheduler()
scheduler = AsyncIOScheduler(timezone=pytz.UTC)

storage = AirtableMealStorage(
config["authentication"]["airtable_base"], config["authentication"]["airtable_key"]
Expand Down
1 change: 0 additions & 1 deletion botto/tld_botto.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def __init__(
name="Meal Reminder",
trigger="cron",
hour=reminder_hours,
timezone=pytz.UTC,
coalesce=True,
)
scheduler.add_job(
Expand Down

0 comments on commit f0600ad

Please sign in to comment.