Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled job is not stopping #543

Open
RubelBiswasCS opened this issue Aug 3, 2022 · 3 comments
Open

Scheduled job is not stopping #543

RubelBiswasCS opened this issue Aug 3, 2022 · 3 comments

Comments

@RubelBiswasCS
Copy link

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
Copy link

JulessZ commented Aug 7, 2022

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

@Charlez91
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants