Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deduplication middleware and publisher decorator #423

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

dkotik
Copy link
Contributor

@dkotik dkotik commented Feb 26, 2024

Useful for many projects. If similar messages appear, discards all but the first one in a given time window.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 71.01449% with 40 lines in your changes are missing coverage. Please review.

Project coverage is 66.96%. Comparing base (d20a605) to head (998e7c4).
Report is 3 commits behind head on master.

Files Patch % Lines
message/router/middleware/deduplicator.go 71.01% 29 Missing and 11 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
- Coverage   76.69%   66.96%   -9.74%     
==========================================
  Files          57       64       +7     
  Lines        3012     4277    +1265     
==========================================
+ Hits         2310     2864     +554     
- Misses        563     1239     +676     
- Partials      139      174      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dkotik
Copy link
Contributor Author

dkotik commented Feb 26, 2024

I bumped the coverage to keep Codecov happy.

message/router/middleware/deduplicator.go Outdated Show resolved Hide resolved
message/router/middleware/deduplicator.go Outdated Show resolved Hide resolved
message/router/middleware/deduplicator.go Outdated Show resolved Hide resolved
message/router/middleware/deduplicator.go Outdated Show resolved Hide resolved
message/router/middleware/deduplicator.go Outdated Show resolved Hide resolved
message/router/middleware/deduplicator.go Show resolved Hide resolved
The change was requested by maintainers so that deduplication could be 
distributed.
@dkotik
Copy link
Contributor Author

dkotik commented Mar 28, 2024

@roblaszczak I resolved all the conversations by doing a bit of a re-write to address the core issue: I added the interface ExpiringKeyRepository and flowed everything around that. If somebody implements Redis backend, they can. Perhaps I will later. Requesting re-review.

@dkotik dkotik requested a review from roblaszczak March 28, 2024 12:13
@roblaszczak roblaszczak merged commit eb467a0 into ThreeDotsLabs:master Mar 28, 2024
8 of 10 checks passed
@roblaszczak
Copy link
Member

Thanks @dkotik 🍻

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.

2 participants