dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.71k stars 960 forks source link

Scheduled job is not stopping #543

Open RubelBiswasCS opened 2 years ago

RubelBiswasCS commented 2 years ago

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.

JulessZ commented 2 years ago

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

Charlez91 commented 1 year ago

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 commented 1 year ago

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