Commit 6ec498f
committed
Guard against missing tenant context in jobs
Fail fast when a job runs without the tenant payload injected by
`perform_later`, instead of crashing later on `context["tenant"]`.
This makes accidental `perform_now` usage easier to diagnose:
> Missing tenant context, use perform_later (via
> TenantSwitchEachJob) instead of perform_now
Also avoid enqueueing a job from the Postmark inactive-recipient rescue
path so suppression sync still works in synchronous flows.1 parent 4496102 commit 6ec498f
2 files changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments