-
Notifications
You must be signed in to change notification settings - Fork 122
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
func (cache *Cache) startExpirationProcessing() - Never Exits and Leaves residual Goroutines. #23
Comments
Good call, i'll fix it in the upcoming 2 weeks i think. I guess adding a Close method would work? |
Yep, that should do it! However, maybe "close" is not the right description. Somehow close feels like a non-permanent move. Maybe it's just me ? Since you already have: Maybe one of these two: |
Actually, now that I think about it. Do you feel like getting some help on the package ? I would not mind implementing a fix for you. I can make some adjustments and then deliver them in PR's. |
A pull request is always welcome. i think 'RemoveCache' is a good name but i also like to check if we can use some common standard interface. For example, Closer reads:
type Closer interface {
Close() error
} But in this case i'm happy with either solution. |
Yep, that makes perfect sense. I will take a look this week and see if I can't get this done :) |
@zkynet Can you test this code? Its merged to master but not an official release yet. |
Sweet, I was about to get my hand dirty tonight, but since you already did I'll do a testing session in stead. It'll happen in about 6-7 hours. Good job. |
Completely forgot to report back! It seems that did it. Thanks man! |
Hey, I noticed there is no exit case in your Goroutine here:
https://github.com/ReneKroon/ttlcache/blob/49e7d8e56413a8ee1f826b064e7268f6e10ca2d3/cache.go#L52
I was developing an application that start multiple caches as child-struct. But when the parent is removed this function - func (cache *Cache) startExpirationProcessing() - keeps running forever.
Do you perhaps have a way of killing it somewhere in your code ? I like your package and I would love to keep using it, but in the current state I can not :(
The text was updated successfully, but these errors were encountered: