Skip to content

Conversation

@ukchukx
Copy link

@ukchukx ukchukx commented Sep 7, 2019

Account for job execution time, so the job can be triggered at uniform intervals.
Pass keyword arguments other than interval to the target job.

Solves issue sankalpjonn#7 on the main repo.
@joac-asapp
Copy link

I will love to have this merged

@matfax
Copy link

matfax commented Nov 5, 2019

This PR should also fix #4.
@sankalpjonn Do you still intend to maintain this project?

@Poseideon
Copy link

@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!

@ukchukx
Copy link
Author

ukchukx commented Apr 5, 2020

@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)

@stephan1827
Copy link

@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

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

Successfully merging this pull request may close these issues.

5 participants