Commit 9819f80
committed
UN-2813 [FIX] Ensure backend config returns correct backend_type
Fix critical bug where get_backend_config_for_type() returned configs
with incorrect backend_type field.
**Problem:**
When calling get_backend_config_for_type("hatchet") or "temporal", the
returned config object had backend_type="celery" (inherited default from
BaseWorkerConfig) instead of the requested type. This caused CLI commands
like `--backend=temporal` to spin up the wrong backend.
**Solution:**
- Refactored to use config class map
- Pass backend_type explicitly to config constructor
- Added proper exception chaining with `from None`
**Impact:**
- CLI backend selection now works correctly
- Config objects have correct backend_type field
- Prevents subtle bugs from mismatched backend types
**Example:**
```python
# Before: config.backend_type = "celery" ❌
config = get_backend_config_for_type("temporal")
# After: config.backend_type = "temporal" ✅
config = get_backend_config_for_type("temporal")
```
Resolves: CodeRabbit comment #2386596266
Related: #15551 parent 38a1205 commit 9819f80
1 file changed
+11
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
0 commit comments