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

schedule to stop job which started with scheduling #500

Open
Vernadskii opened this issue Dec 15, 2021 · 1 comment
Open

schedule to stop job which started with scheduling #500

Vernadskii opened this issue Dec 15, 2021 · 1 comment

Comments

@Vernadskii
Copy link

Vernadskii commented Dec 15, 2021

Hi, I have researched issues but didn't find related issues with this.
(#160) <-- is it better to create custom time checker in job and use schedule.CancelJob?
(#226) <-- It looks like what i need, if i right understand
it could be some think like this:
job = schedule.every().day.at("00:00").do(start_logging()).stop("23:59")
Thank you!

@Vernadskii
Copy link
Author

Or i think one of the possible solution may be some think like this sample code:

if __name__ == "__main__":
    job = schedule.every().day.at("00:00").do(start_logging())
    while True:
        jobs = schedule.get_running_jobs()   # which return list, for example
        if len(jobs) > 1:
              jobs[0].kill()    # stop previous job

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

1 participant