Skip to content

feature: log warning when middleware of a given type is added twice#709

Merged
LincolnPuzey merged 2 commits into
masterfrom
chore/duplicate-middleware-warning
May 29, 2025
Merged

feature: log warning when middleware of a given type is added twice#709
LincolnPuzey merged 2 commits into
masterfrom
chore/duplicate-middleware-warning

Conversation

@synweap15

Copy link
Copy Markdown
Collaborator

See: #708

@synweap15 synweap15 requested review from Bogdanp and LincolnPuzey May 27, 2025 09:11
Comment thread dramatiq/broker.py Outdated
point for where the new middleware should be added.

If there's already a middleware object of the same class
added to the broker, it will be replaced.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this comment correct? The test below asserts that both middlewares of the same type are present ("I expect both middlewares to be added").

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@karolinepauls absolutely, I was testing the described approach on the side and I forgot to replace that comment. Update pushed

@LincolnPuzey LincolnPuzey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@LincolnPuzey LincolnPuzey merged commit 729164a into master May 29, 2025
22 checks passed
@LincolnPuzey LincolnPuzey deleted the chore/duplicate-middleware-warning branch May 29, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants