优化redis模块

This commit is contained in:
orgin
2022-10-19 13:47:57 +08:00
parent 17a448f75c
commit b87a78c85b

View File

@@ -192,7 +192,6 @@ func (m *RedisModule) HSetStruct(key string, val interface{}) error {
}
defer conn.Close()
_, err = conn.Do("HSET", redis.Args{}.Add(key).AddFlat(val)...)
if err != nil {
return err
@@ -1151,3 +1150,9 @@ func (m *RedisModule) Keys(key string) ([]string, error) {
}
return strs, nil
}
func (m *RedisModule) OnRelease() {
if m.redisPool != nil {
m.redisPool.Close()
}
}