From f0600ad37c71278691d2d9bc9061af8b2746b8b0 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Wed, 13 Sep 2023 15:07:41 +0100 Subject: [PATCH] Provide UTC as default scheduler timezone. 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 --- __main__.py | 4 +++- botto/tld_botto.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/__main__.py b/__main__.py index caed9c6..6f0589a 100644 --- a/__main__.py +++ b/__main__.py @@ -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 @@ -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"] diff --git a/botto/tld_botto.py b/botto/tld_botto.py index 6f2f8ac..c7fb6a7 100644 --- a/botto/tld_botto.py +++ b/botto/tld_botto.py @@ -133,7 +133,6 @@ def __init__( name="Meal Reminder", trigger="cron", hour=reminder_hours, - timezone=pytz.UTC, coalesce=True, ) scheduler.add_job(