Skip to content

Commit

Permalink
fix: preserve ARQ enqueue_job __kwdefaults__ after patching
Browse files Browse the repository at this point in the history
  • Loading branch information
Marukhin Daniil committed Jan 6, 2025
1 parent bb85c26 commit 7a480dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sentry_sdk/integrations/arq.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def setup_once():
def patch_enqueue_job():
# type: () -> None
old_enqueue_job = ArqRedis.enqueue_job
original_kwdefaults = old_enqueue_job.__kwdefaults__

async def _sentry_enqueue_job(self, function, *args, **kwargs):
# type: (ArqRedis, str, *Any, **Any) -> Optional[Job]
Expand All @@ -83,6 +84,7 @@ async def _sentry_enqueue_job(self, function, *args, **kwargs):
):
return await old_enqueue_job(self, function, *args, **kwargs)

_sentry_enqueue_job.__kwdefaults__ = original_kwdefaults
ArqRedis.enqueue_job = _sentry_enqueue_job


Expand Down

0 comments on commit 7a480dd

Please sign in to comment.