mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:30:56 +00:00
fix memory cache Put method should set value when key exist.
This commit is contained in:
parent
42958ddd41
commit
8e8d39d3cb
4
cache/memory.go
vendored
4
cache/memory.go
vendored
@ -53,11 +53,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error
|
|||||||
Lastaccess: time.Now(),
|
Lastaccess: time.Now(),
|
||||||
expired: expired,
|
expired: expired,
|
||||||
}
|
}
|
||||||
if _, ok := bc.items[name]; ok {
|
|
||||||
return errors.New("the key is exist")
|
|
||||||
} else {
|
|
||||||
bc.items[name] = &t
|
bc.items[name] = &t
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user