Commit 0efae24
fix(dlq): preserve parallel queue type when adding jobs to DLQ (#9)
## Summary
- Fix parallel jobs being converted to serial when requeued from DLQ
- Use empty string instead of "default" for parallel jobs in DLQ
## Problem
When parallel jobs (`Queue::Parallel`) fail and are added to the DLQ,
they were being stored with `queue_name = "default"`. When requeued, the
requeue logic sees a non-empty string and creates
`Queue::Serial("default")` instead of `Queue::Parallel`.
The requeue logic already correctly handles this distinction:
```rust
let queue = if dlq_job.queue_name.is_empty() {
Queue::Parallel // ← Empty string = parallel
} else {
Queue::Serial(dlq_job.queue_name.clone()) // ← Non-empty = serial
};
```
But `add_to_dlq()` and `process_failed_jobs()` were defaulting to
`"default"` instead of empty string for parallel jobs (which have no
`job_queue_id`).
## Fix
- `add_to_dlq()`: Use `String::new()` when `job_queue_id()` is `None`
(parallel job)
- `process_failed_jobs()`: Use `unwrap_or_default()` when `queue_name`
is `NULL`
This ensures parallel jobs stay parallel when requeued from DLQ.
## Test plan
- [x] `cargo check` passes
- [x] `just fmt` - no changes needed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 3a2d681 commit 0efae24
2 files changed
Lines changed: 63 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
497 | 499 | | |
498 | 500 | | |
499 | 501 | | |
| |||
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
508 | | - | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
509 | 513 | | |
510 | 514 | | |
511 | 515 | | |
| |||
618 | 622 | | |
619 | 623 | | |
620 | 624 | | |
621 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
622 | 628 | | |
623 | 629 | | |
624 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
293 | 347 | | |
294 | 348 | | |
295 | 349 | | |
| |||
0 commit comments