Enforce functools.wraps on all monkeypatches
See original GitHub issueI’m using celery-once
to make sure some tasks are only run one at a time. The lock is acquired in apply_async
and released in after_return
.
When I use the CeleryIntegration
I’m not seeing any of the locks being released after the task has finished running. I’m not very familiar with the inner workings of celery, but any ideas what’s going on?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Use functools.wraps or wrapt for decorators #170 - GitHub
The long-term solution here is to not monkey-patch methods onto classes, but in the short run, what should I do? The obvious easy...
Read more >decorator module vs functools.wraps - python - Stack Overflow
One of the main differences is listed right in the documentation you linked to: decorator preserves the signature of the wrapped function, while...
Read more >functools — Higher-order functions and operations on callable ...
The functools module is for higher-order functions: functions that act on or return other functions. In general, any callable object can be treated...
Read more >Python | functools.wraps() function - GeeksforGeeks
wraps () is a decorator that is applied to the wrapper function of a decorator. It updates the wrapper function to look like...
Read more >Hear no evil, see no evil, patch no evil: Or, how to monkey ...
wraps () help? import functools def function_wrapper(. No, it doesn't solve all problems. Still issues with: introspection, wrapping decorators ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Since this is blocking you I’ll just get a minimal fix out of the door.
Proper wrapping will likely take more effort (possibly using wrapt instead of functools).
We should do this everywhere then. Monkeypatches are quite inconsistent across the codebase.