Update TwinProduction/gocache to v1.2.2

This commit is contained in:
TwinProduction
2021-06-06 14:54:58 -04:00
parent e214d56af1
commit ca87547430
13 changed files with 180 additions and 73 deletions

View File

@ -131,8 +131,8 @@ func (cache *Cache) StartJanitor() error {
func (cache *Cache) StopJanitor() {
if cache.stopJanitor != nil {
// Tell the janitor to stop, and then wait for the janitor to reply on the same channel that it's stopping
// This may seem a bit odd, but this allows us to avoid a data race condition in which setting cache.stopJanitor
// to nil
// This may seem a bit odd, but this allows us to avoid a data race condition when trying to set
// cache.stopJanitor to nil
cache.stopJanitor <- true
<-cache.stopJanitor
cache.stopJanitor = nil