Open ukchukx opened 5 years ago
I will love to have this merged
This PR should also fix #4. @sankalpjonn Do you still intend to maintain this project?
@ukchukx , I was using your commits and wanted to know how to setup the job with arguments. Can you please share an example how I could decorate below function that accepted parameters -
@tl.job(interval=timedelta(seconds=2)) def sample_job_every_Ns(nseconds): print "{}s job current time : {}".format(nseconds, time.ctime())
Thanks!
@Poseideon Maybe this could help:
@tl.job(interval=timedelta(seconds=10), this='that', that='this', other=1)
def todo(this, that, other):
print(this, that, other)
@Poseideon Maybe this could help:
@tl.job(interval=timedelta(seconds=10), this='that', that='this', other=1) def todo(this, that, other): print(this, that, other)
I tried the changes but when I try to pass arguments I get
Exception has occurred: TypeError job() got an unexpected keyword argument 'this'
The error message makes sense because job still only expects interval as parameter. Do I miss something here?
Stephan
Account for job execution time, so the job can be triggered at uniform intervals. Pass keyword arguments other than
interval
to the target job.