Skip to content

Commit

Permalink
jobqueue: Add docstring note about intervals and DST
Browse files Browse the repository at this point in the history
Fixes #1381
  • Loading branch information
tsnoam committed Apr 26, 2019
1 parent 2cde878 commit e12ecf4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions telegram/ext/jobqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ def run_repeating(self, callback, interval, first=None, context=None, name=None)
: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,
Expand Down Expand Up @@ -202,6 +207,11 @@ def run_daily(self, callback, time, days=Days.EVERY_DAY, context=None, name=None
: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),
Expand Down

0 comments on commit e12ecf4

Please sign in to comment.