Commit 4e4c413
fix(rq): Support rq 2.7.0+ where SimpleWorker inherits from BaseWorker
In rq 2.7.0, SimpleWorker was changed to inherit directly from
BaseWorker instead of Worker. This meant our monkey-patches on
Worker.perform_job and Worker.handle_exception were bypassed for
SimpleWorker, causing no Sentry events to be captured.
Patch BaseWorker when available (rq >= 1.7.0) to cover both Worker
and SimpleWorker. Fall back to patching Worker for older versions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 963b4dd commit 4e4c413
1 file changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
43 | 48 | | |
44 | 49 | | |
45 | 50 | | |
46 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
47 | 57 | | |
48 | 58 | | |
49 | 59 | | |
| |||
78 | 88 | | |
79 | 89 | | |
80 | 90 | | |
81 | | - | |
| 91 | + | |
82 | 92 | | |
83 | | - | |
| 93 | + | |
84 | 94 | | |
85 | 95 | | |
86 | 96 | | |
| |||
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
99 | | - | |
| 109 | + | |
100 | 110 | | |
101 | 111 | | |
102 | 112 | | |
| |||
0 commit comments