Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for execution time #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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