Commit 646849b
fix(rq): Support rq 2.7.0+ where SimpleWorker inherits from BaseWorker (#5505)
## Summary
- In rq 2.7.0, `SimpleWorker` was refactored to inherit directly from
`BaseWorker` instead of `Worker`
([rq#2336](rq/rq#2336)). This broke our
integration because we only monkey-patched `Worker.perform_job` and
`Worker.handle_exception`, which `SimpleWorker` no longer inherits.
- Now patches `BaseWorker` when available (rq >= 1.7.0), falling back to
`Worker` for older versions. Since both `Worker` and `SimpleWorker`
inherit from `BaseWorker`, this covers both worker types.
## Test plan
- [x] `py3.14-rq-v2.6.1`: 10 passed (backward compat)
- [x] `py3.14-rq-v2.7.0`: 10 passed (new version)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 8a8d14a commit 646849b
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| |||
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
| |||
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
81 | | - | |
| 95 | + | |
82 | 96 | | |
83 | | - | |
| 97 | + | |
84 | 98 | | |
85 | 99 | | |
86 | 100 | | |
| |||
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
99 | | - | |
| 113 | + | |
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
| |||
0 commit comments