Skip to content

Unexpected behaviour of .delay #10

@electronick1

Description

@electronick1

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions