-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
-
I need to obtain the exact time when the job will be executed. To do so i'm currently accessing job_queue._queue.queue. Is there some other function for this purpose that i'm missing?
-
I need to be able to force job execution or postpone it. Is there any more simple way to do it?
To force job execution I do (To postpone execution I do similar thing but without step 1 of course):
- create a new job with job_queue.run_once that will run the callback right now
- disable the current job and set it's interval to (base_interval - (t - now)). (t is time when the job supposed to be executed according to it's original interval)
- create a job that will run in (t - now) seconds and will enable the forced job and set it's interval to base_interval (so the job would keep working with the original interval as it was before forcing it).
And the problem with my method is that some time after the job was postponed or forced I cannot access the time it will be executed with job_queue._queue.queue and I need to calculate it and store it somewhere else.
I think postponing, forcing the jobs and accessing the time job will be executed should be more straightforward and it should be handled by the library. Am I wrong?