cameronmaske / celery-once

Celery Once allows you to prevent multiple execution and queuing of celery tasks.
https://pypi.python.org/pypi/celery_once/
BSD 2-Clause "Simplified" License
661 stars 90 forks source link

get_key doesn't work with autoretry_for #74

Closed pkariz closed 5 years ago

pkariz commented 6 years ago

OS: debian 9 stretch

When autoretry_for is passed as a kwarg to a task, celery wraps task.run method and stores original task.run method in task._orig_run. Currently get_key always checks task.run and the inspection of arguments doesn't return the right values. The solution is to check if _orig_run exists on task and if it does, inspect this method for arguments. I have created a PR #75 which includes a proposed fix and a test which covers that problem.

cameronmaske commented 5 years ago

Should be fixed in 2.0.1. Thanks for the patch @pkariz!