schedule icon indicating copy to clipboard operation
schedule copied to clipboard

Scheduled job is not stopping

Open RubelBiswasCS opened this issue 2 years ago • 3 comments

I am using the python schedule to schedule a task. The script is running on a server, The script is triggered via API call. For testing purposes, I set the schedule to run every 5 minutes and it worked fine as It should.

The problem arise when I ran the script next time with a different job at a different schedule/time. I can't see any effect of the current schedule. Instead, I am getting the output of the previously running job (which is running in 5 minutes intervals). So what I need to know is, why the job is still running even after script restart and how to stop jobs that are scheduled previously/ replace them with the latest schedule.

RubelBiswasCS avatar Aug 03 '22 03:08 RubelBiswasCS

Would be nice to see how you programmed it to understand the E2E @RubelBiswasCS

JulessZ avatar Aug 07 '22 09:08 JulessZ

Schedule has something like a Memory which stores jobs so it can run dem at said time. So in ur code before the new job do Schedule.clear() Then Run your job

Charlez91 avatar Sep 24 '22 03:09 Charlez91

The schedule.clear clears any previous job in the schedule 'memory'

Charlez91 avatar Sep 24 '22 03:09 Charlez91