Repository navigation
Clean up dead circuit breaker code and add audit-log retention purge - #1666
Merged
Merged
Conversation
…ation in CircuitB Closes solutions-plug#1500
|
@marvs8 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clean up dead circuit breaker code and add audit-log retention purge
What was solved
#1500 — Remove dead self-referential duration calculation in CircuitBreaker::state()
Remove the dead self-referential
Instant::now().duration_since(Instant::now())computation and the unusedelapsedvariable fromCircuitBreaker::state()inservices/api/src/cache/mod.rs, leaving only theSystemTime-based calculation. This is a surgical, single-file cleanup in the Redis circuit breaker path with no behavioral change, so existing circuit breaker unit tests remain unaffected.Addressed:
duration_since(Instant::now())computation inCircuitBreaker::state()(around lines 44-50).elapsedvariable and itslet _ = elapsed;discard.CircuitBreaker::state()only performs theSystemTime-based calculation.#1501 — Add retention/purge job for the audit_logs table
Add a configurable audit-log retention window and a scheduled purge worker that deletes old audit_logs rows in batches, mirroring the existing newsletter_cleanup/api_key_cleanup workers, with logging/metrics and a test.
Addressed:
Changes
README.md(modify)services/api/src/audit.rs(modify)Approach
Issues
Closes #1500
Closes #1501