You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using gocache and finding it very useful. However, I have encountered an issue.
I am using Ristretto alongside gocache, and Ristretto internally spawns goroutines. These goroutines can be terminated using the Close() method provided by Ristretto. Unfortunately, in the current implementation of gocache, there is no way to terminate these goroutines. While Clear(ctx context.Context) is available, in the case of Ristretto, it only clears the cache and starts a new goroutine instead of terminating the existing one.
As a result, when the application undergoes a hot reload, even after calling Clear, the existing goroutines remain active. It seems there is no way to address this issue at the moment. Is there any possibility for this to be changed or improved in the future?
If the cache is created and returned as in the code below, the calling function will not be able to close the Ristretto cache.
example:
Hello,
I am using gocache and finding it very useful. However, I have encountered an issue.
I am using Ristretto alongside gocache, and Ristretto internally spawns goroutines. These goroutines can be terminated using the
Close()
method provided by Ristretto. Unfortunately, in the current implementation of gocache, there is no way to terminate these goroutines. WhileClear(ctx context.Context)
is available, in the case of Ristretto, it only clears the cache and starts a new goroutine instead of terminating the existing one.As a result, when the application undergoes a hot reload, even after calling
Clear
, the existing goroutines remain active. It seems there is no way to address this issue at the moment. Is there any possibility for this to be changed or improved in the future?If the cache is created and returned as in the code below, the calling function will not be able to close the Ristretto cache.
example:
Thank you!
The text was updated successfully, but these errors were encountered: