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

[feature] Prune timelines once per hour to plug memory leak #1117

Merged
merged 8 commits into from
Nov 22, 2022

Conversation

tsmethurst
Copy link
Contributor

@tsmethurst tsmethurst commented Nov 22, 2022

Add Start() function to timeline manager, which kicks off a cleanup goroutine.

Once per hour, this goroutine iterates through all timelines in the manager's sync map.

For each timeline, it will call the Prune function. Prune checks if the timeline hasn't been accessed for an hour or more. If so, it will lock the timeline, remove entries from the back, and then unlock the timeline.

Also some small bits and bobs of tidying up.

Closes #394 , though we'll definitely want to switch to a better solution when we have time, this is a good-enough temporary fix :)

@tsmethurst tsmethurst marked this pull request as ready for review November 22, 2022 13:42
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc merged commit 50dc179 into main Nov 22, 2022
@NyaaaWhatsUpDoc NyaaaWhatsUpDoc deleted the prune_timelines branch November 22, 2022 18:38
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.

[feature] Prune timelines after x entries to avoid eating up memory
2 participants