Skip to content

Commit

Permalink
fix: preserve ARQ enqueue_job __kwdefaults__ after patching (#3903)
Browse files Browse the repository at this point in the history
Co-authored-by: Marukhin Daniil <[email protected]>
  • Loading branch information
danmr and Marukhin Daniil authored Jan 7, 2025
1 parent fd22494 commit 235f558
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 235f558

Please sign in to comment.