improve cache modules. support mulit instances
This commit is contained in:
4
cache/memory.go
vendored
4
cache/memory.go
vendored
@@ -44,7 +44,7 @@ type MemoryCache struct {
|
||||
}
|
||||
|
||||
// NewMemoryCache returns a new MemoryCache.
|
||||
func NewMemoryCache() *MemoryCache {
|
||||
func NewMemoryCache() Cache {
|
||||
cache := MemoryCache{items: make(map[string]*MemoryItem)}
|
||||
return &cache
|
||||
}
|
||||
@@ -234,5 +234,5 @@ func (bc *MemoryCache) itemExpired(name string) bool {
|
||||
}
|
||||
|
||||
func init() {
|
||||
Register("memory", NewMemoryCache())
|
||||
Register("memory", NewMemoryCache)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user