sankalpjonn / timeloop

An elegant periodic task executor
MIT License
245 stars 49 forks source link

restarting a job after stopped by exception #20

Open sicenul opened 3 years ago

sicenul commented 3 years ago
@tl.job(interval=timedelta(seconds=10))
def sample_job_every_10s():
   try:
       print "10s job current time : {}".format(time.ctime())
   except Exception as e:
       print(e)
       pass

Assume that there is an error and successfully catched by try except. The timeloop job is stopped, and not rechecking after 10s.
So, can I restart the timeloop job again? How? Thanks in advance.