-
Notifications
You must be signed in to change notification settings - Fork 33
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
Periodically garbage collect #51
Comments
Why is |
Not exporting it was probably a mistake, @magik6k? |
Gotcha, I'll submit a PR. Another thing, overriding the error here creates ambiguity: https://github.com/ipfs/go-ds-badger/blob/master/datastore.go#L286. Badger returns nil if one file was collected, and callers may use this as a hint to continue collecting by calling GC again. Overriding the "nothing was collected" error to nil makes it impossible to discriminate whether it's worth calling GC again or not :-( If we want to decouple this from badger implementation-specific errors, we can return a second value to signal if something was collected, or not, or we don't know (some stores may not expose this event). |
That's the issue. However, for every datastore except badger, re-running GC till it removes nothing is just a waste of time so I'm not sure how useful that is. See #56 that just does this automatically. |
Yeah, I probably meant to export it, but also set some value that would mostly work to quickly test and never changed it |
@Stebalien Is this up for grabs ? |
Yes! (it's also pretty easy to review so it should get merged pretty quickly). |
Fixed in #72. |
We should periodically garbage collect in case the user has garbage collection turned off. Otherwise, we'll never delete anything.
The text was updated successfully, but these errors were encountered: