-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
In my bot I have a run_daily job which should execute each Monday night at 0:01 however it runs at some arbitrary time in the afternoon after some weeks. The server clock is correct.
I think this is because even if you set a time point in run_daily, an interval is subsequently calculated by the jobqueue class and if the job's called function takes some time to complete or the job cannot be run immediately as other jobs are running, the job is afterwards put again into the queue but with some shift! This should be fixed, e.g. that the exact time point is stored in the job object and the interval at which it has to be called again is then calculated each time.
Steps to reproduce
-
Create a function that takes a long time to finish. (30min+)
-
Put that function into the jobQueue using run_daily and set a specific time point at which it should run each day.
-
Let it run for some days.
Expected behaviour
The job should run each day at exactly the same time.
Actual behaviour
The time at which the job runs is slowly shifting to later time points.
Configuration
Operating System:
Ubuntu
Version of Python, python-telegram-bot & dependencies:
Python 3.6, python-telegram-bot v11.1.0