数据库缓存更新

This commit is contained in:
hoteas
2018-04-09 20:10:58 +00:00
parent 7700ba7658
commit 58ab6ef01f
2 changed files with 36 additions and 27 deletions
+3
View File
@@ -49,6 +49,9 @@ func main() {
}
return DB
})
//内存缓存数据库数据,错误则删除
// appIns.Db.CacheIns=hotime.CacheIns(&hotime.CacheMemory{})
appIns.SetSession(hotime.CacheIns(&hotime.CacheMemory{}), hotime.CacheIns(&hotime.CacheDb{Db: &appIns.Db, Time: appIns.Config.GetInt64("cacheTime")}))
appIns.SetCache(hotime.CacheIns(&hotime.CacheMemory{}))