From 9d005d5124eca1787c70a09b471c9450238abf83 Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Sat, 27 Apr 2019 21:10:56 +0300 Subject: [PATCH] jobqueue: Add docstring note about intervals and DST (#1397) Fixes #1381 --- telegram/ext/jobqueue.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/telegram/ext/jobqueue.py b/telegram/ext/jobqueue.py index e3cfacfd9..0cfa539cf 100644 --- a/telegram/ext/jobqueue.py +++ b/telegram/ext/jobqueue.py @@ -172,6 +172,11 @@ class JobQueue(object): :class:`telegram.ext.Job`: The new ``Job`` instance that has been added to the job queue. + Notes: + `interval` is always respected "as-is". That means that if DST changes during that + interval, the job might not run at the time one would expect. It is always recommended + to pin servers to UTC time, then time related behaviour can always be expected. + """ job = Job(callback, interval=interval, @@ -202,6 +207,11 @@ class JobQueue(object): :class:`telegram.ext.Job`: The new ``Job`` instance that has been added to the job queue. + Notes: + Daily is just an alias for "24 Hours". That means that if DST changes during that + interval, the job might not run at the time one would expect. It is always recommended + to pin servers to UTC time, then time related behaviour can always be expected. + """ job = Job(callback, interval=datetime.timedelta(days=1),