Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jobqueue: Add docstring note about intervals and DST #1397

Merged
merged 1 commit into from
Apr 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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