From 34f9b79a23e19bda63835f2228b8e4628ea70aff Mon Sep 17 00:00:00 2001 From: Scott Koranda Date: Sat, 27 Jul 2019 15:37:40 -0500 Subject: [PATCH] Add timezone argument for IntervalTrigger Since the start_date passed into the apscheduler.triggers.interval.IntervalTrigger instances is explicitly using UTC the timezone argument needs to be passed with UTC as a value. Since apscheduler only supports pytz and not datetime.timezone we pass in timezone=pytz.utc. --- src/pyff/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pyff/api.py b/src/pyff/api.py index c264e4b0..af1e370b 100644 --- a/src/pyff/api.py +++ b/src/pyff/api.py @@ -19,6 +19,7 @@ from pyramid.events import NewRequest import requests import threading +import pytz log = get_log(__name__) @@ -397,6 +398,7 @@ def mkapp(*args, **kwargs): start_date=start, seconds=config.update_frequency, replace_existing=True, - max_instances=1) + max_instances=1, + timezone=pytz.utc) return ctx.make_wsgi_app()