sankalpjonn / timeloop

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

@timeloop.job does not accept arguments #7

Open niloysh opened 5 years ago

niloysh commented 5 years ago

While adding tasks using the decorator, it does not accept arguments.

It may be fixed by:

def job(self, interval):
    def decorator(f):
       # fix: this wrapper needs to be added
        def wrapper(*args, **kwargs):
            self._add_job(f, interval, *args, **kwargs)
            return f
        return wrapper
    return decorator
ukchukx commented 5 years ago

See this pull request