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

Improve the Reaper logic #37

Open
johanix opened this issue May 25, 2024 · 0 comments
Open

Improve the Reaper logic #37

johanix opened this issue May 25, 2024 · 0 comments

Comments

@johanix
Copy link
Collaborator

johanix commented May 25, 2024

Currently, the ReaperData structure is a map[deletetime]map[name]bool. This is not convenient (because the map[deletetime] isn't sorted) when hunting for old slots that failed to get deleted when they should.

A likely better alternative would be to just store the ReaperData as a sorted []ReaperObject (for lack of a better name), where a ReaperObject has a ReaperTime (when to delete) and, again, a map[name]bool (set of names to delete). Adding to the ReaperData becomes just an append() and when running the reaper we just scan from the front and delete as long as the ReaperTime is in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant