fix: redis GetHashBatch检查索引是否越界

This commit is contained in:
TsMask committed 2024-12-04 11:26:41 +08:00
1 parent a0a224ce81
commit f8fde36e14
1 file changed
+4
+4
View File
@@ -277,6 +277,10 @@ func GetHashBatch(source string, keys []string) (map[string]map[string]string, e
}
for i := 0; i < total; i += batchSize {
// 检查索引是否越界
if i+batchSize > total {
batchSize = total - i
}
wg.Add(1)
go func(start int) {
ctx := context.Background()