hotgo/server/internal/library/hgorm/handler/force_cache.go

11 lines
198 B
Go

package handler
import (
"github.com/gogf/gf/v2/database/gdb"
)
// ForceCache 强制缓存
func ForceCache(m *gdb.Model) *gdb.Model {
return m.Cache(gdb.CacheOption{Duration: 0, Force: true})
}