style(cache): 格式化代码注释中的空格并添加 DISTINCT 选项

- 修复了缓存相关文件中注释开头缺少空格的问题
- 在 db/hotimedb.go 中为 vcond 数组添加了 "DISTINCT" 选项
- 注释掉了 session.go 中的并发控制代码以简化实现
This commit is contained in:
2026-01-22 02:44:53 +08:00
parent 2ecb12bd7d
commit 7843f7e8d6
13 changed files with 26 additions and 19 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import (
)
// HoTimeCache 可配置memorydbredis,默认启用memory,默认优先级为memory>redis>db,memory与数据库缓存设置项一致,
//缓存数据填充会自动反方向反哺,加入memory缓存过期将自动从redis更新,但memory永远不会更新redis,如果是集群建议不要开启memory,配置即启用
// 缓存数据填充会自动反方向反哺,加入memory缓存过期将自动从redis更新,但memory永远不会更新redis,如果是集群建议不要开启memory,配置即启用
type HoTimeCache struct {
*Error
dbCache *CacheDb
+2 -2
View File
@@ -87,7 +87,7 @@ func (that *CacheDb) initDbTable() {
}
//获取Cache键只能为string类型
// 获取Cache键只能为string类型
func (that *CacheDb) get(key string) interface{} {
cached := that.Db.Get("cached", "*", Map{"key": key})
@@ -108,7 +108,7 @@ func (that *CacheDb) get(key string) interface{} {
return data.Get("data")
}
//key value ,时间为时间戳
// key value ,时间为时间戳
func (that *CacheDb) set(key string, value interface{}, tim int64) {
bte, _ := json.Marshal(Map{"data": value})
+2 -2
View File
@@ -30,7 +30,7 @@ func (that *CacheRedis) SetError(err *Error) {
that.Error = err
}
//唯一标志
// 唯一标志
func (that *CacheRedis) GetTag() int64 {
if that.tag == int64(0) {
@@ -85,7 +85,7 @@ func (that *CacheRedis) del(key string) {
}
}
//key value ,时间为时间戳
// key value ,时间为时间戳
func (that *CacheRedis) set(key string, value string, time int64) {
_, err := that.conn.Do("SET", key, value, "EX", ObjToStr(time))
if err != nil {
+1 -1
View File
@@ -13,7 +13,7 @@ type CacheIns interface {
Cache(key string, data ...interface{}) *Obj
}
//单条缓存数据
// 单条缓存数据
type cacheData struct {
time int64
data interface{}