上传redis 批量读写优化
This commit is contained in:
parent
a2273fa1d1
commit
12b8a79432
@ -550,7 +550,7 @@ func (this *MCompModel) batchsetlists(data map[string]map[string]string) (err er
|
||||
values []interface{}
|
||||
)
|
||||
keys = make([]string, len(data))
|
||||
values = make([]interface{}, len(data))
|
||||
values = make([]interface{}, 0)
|
||||
|
||||
for k, v := range data {
|
||||
keys[n] = k
|
||||
@ -558,8 +558,9 @@ func (this *MCompModel) batchsetlists(data map[string]map[string]string) (err er
|
||||
values = append(values, k1, v1)
|
||||
}
|
||||
values = append(values, "#end")
|
||||
n++
|
||||
}
|
||||
ret := this.Redis.EvalSha(this.Redis.Context(), this.getListSha1, keys, values...)
|
||||
ret := this.Redis.EvalSha(this.Redis.Context(), this.setListSha1, keys, values...)
|
||||
if _, err := ret.Result(); err != nil {
|
||||
fmt.Printf("Execute batchsetlists err: %v", err.Error())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user