schedule
schedule copied to clipboard
schedule to stop job which started with scheduling
Hi, I have researched issues but didn't find related issues with this.
(https://github.com/dbader/schedule/issues/160) <-- is it better to create custom time checker in job and use schedule.CancelJob?
(https://github.com/dbader/schedule/pull/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!
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