1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 12:30:54 +00:00

Update memory.go

This commit is contained in:
Dennis 2018-11-13 14:43:23 +08:00 committed by GitHub
parent 0333e26b3e
commit 9e036bcab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
cache/memory.go vendored
View File

@ -209,7 +209,11 @@ func (bc *MemoryCache) StartAndGC(config string) error {
// check expiration. // check expiration.
func (bc *MemoryCache) vacuum() { func (bc *MemoryCache) vacuum() {
if bc.Every < 1 { bc.RLock()
every := bc.Every
bc.RUnlock()
if every < 1 {
return return
} }
for { for {