This commit is contained in:
@@ -8,8 +8,35 @@ import (
|
||||
|
||||
// /取消redis空节点的强制缓存
|
||||
func dbm(m cool.IModel) *gdb.Model {
|
||||
return cool.DBM(m).
|
||||
Cache(gdb.CacheOption{
|
||||
Force: true,
|
||||
ret := cool.DBM(m)
|
||||
if cool.Config.ServerInfo.IsVip == 0 { //正式服启动缓存
|
||||
ret = ret.Where("is_enable", 1)
|
||||
}
|
||||
if cool.Config.ServerInfo.IsDebug == 0 {
|
||||
|
||||
ret = ret.Cache(gdb.CacheOption{
|
||||
Force: false,
|
||||
})
|
||||
}
|
||||
return ret
|
||||
}
|
||||
func dbm_fix(m cool.IModel) *gdb.Model {
|
||||
ret := cool.DBM(m).Cache(gdb.CacheOption{
|
||||
Force: false,
|
||||
})
|
||||
|
||||
return ret
|
||||
}
|
||||
func dbm_nocache(m cool.IModel) *gdb.Model {
|
||||
ret := cool.DBM(m)
|
||||
if cool.Config.ServerInfo.IsVip == 0 { //正式服启动缓存
|
||||
ret = ret.Where("is_enable", 1)
|
||||
}
|
||||
// if cool.Config.ServerInfo.IsDebug == 0 {
|
||||
|
||||
// ret = ret.Cache(gdb.CacheOption{
|
||||
// Force: false,
|
||||
// })
|
||||
// }
|
||||
return ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user