All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor(config): 移除未使用的数据库查询函数 移除了 dbm_nocache 函数,该函数已被注释掉且不再使用, 同时保留了 dbm_nocache_noenable 函数用于无缓存查询操作。 ```
39 lines
678 B
Go
39 lines
678 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
|
|
"github.com/gogf/gf/v2/database/gdb"
|
|
)
|
|
|
|
// /取消redis空节点的强制缓存
|
|
func dbm_enable(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: true,
|
|
})
|
|
}
|
|
return ret
|
|
}
|
|
func dbm_notenable(m cool.IModel) *gdb.Model {
|
|
ret := cool.DBM(m)
|
|
if cool.Config.ServerInfo.IsDebug == 0 {
|
|
|
|
ret = ret.Cache(gdb.CacheOption{
|
|
Force: true,
|
|
})
|
|
}
|
|
return ret
|
|
}
|
|
|
|
func dbm_nocache_noenable(m cool.IModel) *gdb.Model {
|
|
ret := cool.DBM(m)
|
|
|
|
return ret
|
|
}
|