Commit 3821b2cb authored by JessonChan's avatar JessonChan

createdTime typo fixed

parent 8aed4c13
......@@ -27,11 +27,11 @@ var (
DefaultEvery = 60 // 1 minute
)
// MemoryItem store enery cache item.
// MemoryItem store memory cache item.
type MemoryItem struct {
val interface{}
cratedTime time.Time
lifespan int64
val interface{}
createdTime time.Time
lifespan int64
}
func (mi *MemoryItem) isExpire() bool {
......@@ -39,7 +39,7 @@ func (mi *MemoryItem) isExpire() bool {
if mi.lifespan == 0 {
return false
}
return time.Now().Unix()-mi.cratedTime.Unix() > mi.lifespan
return time.Now().Unix()-mi.createdTime.Unix() > mi.lifespan
}
// MemoryCache is Memory cache adapter.
......@@ -88,7 +88,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, lifespan int64) error
defer bc.Unlock()
bc.items[name] = &MemoryItem{
val: value,
cratedTime: time.Now(),
createdTime: time.Now(),
lifespan: lifespan,
}
return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment