schedule
schedule copied to clipboard
Scheduled job is not stopping
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.
Would be nice to see how you programmed it to understand the E2E @RubelBiswasCS
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
The schedule.clear clears any previous job in the schedule 'memory'