Skip to content

cleanly error adding queue to client w/out workers#826

Merged
bgentry merged 1 commit intomasterfrom
bg-bad-queue-bundle-behavior
Apr 2, 2025
Merged

cleanly error adding queue to client w/out workers#826
bgentry merged 1 commit intomasterfrom
bg-bad-queue-bundle-behavior

Conversation

@bgentry
Copy link
Copy Markdown
Contributor

@bgentry bgentry commented Apr 1, 2025

Prior to this change, calling .Add() on the QueueBundle for a Client which wasn't configured to run any jobs (i.e. no Workers configured) resulted in a panic due to a missing completer internally:

panic: producerConfig.Completer is required [recovered]
	panic: producerConfig.Completer is required

This changes the behavior to cleanly error with a descriptive message instead. Open to any cleaner way to improve this if you have ideas! 🙏

@bgentry bgentry added the bug Something isn't working label Apr 1, 2025
@bgentry bgentry requested a review from brandur April 1, 2025 20:03
Prior to this change, calling `.Add()` on the `QueueBundle` for a
`Client` which wasn't configured to run any jobs (i.e. no `Workers`
configured) resulted in a panic due to a missing completer internally.

This changes the behavior to cleanly error with a descriptive message
instead.
@bgentry bgentry force-pushed the bg-bad-queue-bundle-behavior branch from f3b494c to 49caf15 Compare April 1, 2025 20:04
Copy link
Copy Markdown
Contributor

@brandur brandur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, doh. Yeah improving the error seems like a good option for now.

@bgentry bgentry merged commit 6dc8263 into master Apr 2, 2025
10 checks passed
@bgentry bgentry deleted the bg-bad-queue-bundle-behavior branch April 2, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants