1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-13 22:57:05 +08:00
parent d258274322
commit e5c75f7359
51 changed files with 230 additions and 254 deletions

View File

@@ -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
}