Reputation: 736
I am using @job
decorator to define a task as below:
rqueue = Queue(connection=Redis.from_url(REDIS_URL))
@job(queue=rqueue)
def add(x, y):
time.sleep(2)
return x+y
this works fine when I call it like add.delay(100, 100)
. But I need to provide success and callback handler for my job. When I define my job as @job(queue=rqueue, on_success=my_callback_func)
it fails with a message saying that it got an unexpected keyword argument on_success
.
If I enqueue the job like below it works smoothly:
rqueue.enqueue(add, on_success=my_callback_func)
I also tried passing the callback handler with delay
function but no luck.
Please Help !!!
Upvotes: 3
Views: 1018