muesli / cache2go

Concurrency-safe Go caching library with expiration capabilities and access counters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maybe expirationCheck() which in cachetable.go have a little issues?

Hu-Jiang opened this issue · comments

In expirationCheck function, whether below code should in the function's end(), in other words , i mean in the table.Unlock()'s front ?

if table.cleanupInterval > 0 {
	table.log("Expiration check triggered after", table.cleanupInterval, "for table", table.name)
} else {
	table.log("Expiration check installed for table", table.name)
}

i think, if do this, the log message is more exact and reasonable.

这段代码应该是表示当前这次的expirationCheck执行距离上次的Interval, 如果放在最后边,cleanupInterval就变成了当前这次距离下次的interval