缓存测试成功

This commit is contained in:
hoteas
2021-05-28 23:48:33 +08:00
parent 1101937028
commit 339302956a
6 changed files with 40 additions and 35 deletions
+5 -5
View File
@@ -467,7 +467,7 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map {
qs = append(qs, resWhere...)
md5 := that.md5(query, qs...)
if that.HoTimeCache != nil {
if that.HoTimeCache != nil && table != "cached" {
//如果缓存有则从缓存取
cacheData := that.HoTimeCache.Db(table + ":" + md5)
@@ -484,7 +484,7 @@ func (that *HoTimeDB) Select(table string, qu ...interface{}) []Map {
}
//缓存
if that.HoTimeCache != nil {
if that.HoTimeCache != nil && table != "cached" {
_ = that.HoTimeCache.Db(table+":"+md5, res)
}
@@ -888,7 +888,7 @@ func (that *HoTimeDB) Update(table string, data Map, where Map) int64 {
//如果更新成功,则删除缓存
if rows != 0 {
if that.HoTimeCache != nil {
if that.HoTimeCache != nil && table != "cached" {
_ = that.HoTimeCache.Db(table+"*", nil)
}
}
@@ -911,7 +911,7 @@ func (that *HoTimeDB) Delete(table string, data map[string]interface{}) int64 {
//如果删除成功,删除对应缓存
if rows != 0 {
if that.HoTimeCache != nil {
if that.HoTimeCache != nil && table != "cached" {
_ = that.HoTimeCache.Db(table+"*", nil)
}
}
@@ -953,7 +953,7 @@ func (that *HoTimeDB) Insert(table string, data map[string]interface{}) int64 {
//如果插入成功,删除缓存
if id != 0 {
if that.HoTimeCache != nil {
if that.HoTimeCache != nil && table != "cached" {
_ = that.HoTimeCache.Db(table+"*", nil)
}
}