-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Before job added to the queue, we executing adv_bind_arguments
here
If processor has **kwargs
defined inside, all data will be lost and "Argument missing" error will be raised. This is example of adv_bind_arguments behaviour with **kwargs
function:
from sqs_workers.utils import adv_bind_arguments
def wrapper_func(*args, **kwargs):
def func(a):
print(a)
func(*args, **kwargs)
print(args, kwargs)
adv_bind_arguments(wrapper_func, [], dict(a=1))
# pring result: {'args': (), 'kwargs': {}}
As you can see a=1
is lost and "Argument missing" error will be raise when processor will try to execute this job.
This is especially critical when you want to decorate your sqs processor, because you should have *args, **kwargs
statement inside a decorator.