Open edilsonpecanha opened 6 years ago
You can just create a new function that has both job1()
and job2()
import time
def now():
return time.strftime("%H:%M:%S")
def job1():
print("Working 10..." + now())
time.sleep(10)
print("Working 11..." + now())
def job2():
print("Working 20..." + now())
time.sleep(10)
print("Working 21..." + now())
def jobs():
job1()
job2()
schedule.every(30).seconds.do(jobs)
How to create schedule with jobs dependency? Example: job2 execute only if job1 executed with success.
I try do this, but not working:
The program execute only last "do". Result of execution: I'm working 20...17:39:34 I'm working 21...17:39:44 I'm working 20...17:39:44 I'm working 21...17:39:54 I'm working 20...17:39:54 I'm working 21...17:40:04