Skip to content

Commit

Permalink
fix(storage/redis): add check for empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
monrax committed Jan 16, 2024
1 parent 35e1e74 commit e23cc7f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion storage/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,26 @@ func (r *RedisClusterStorageManager) GetAndDeleteSet(keyName string, chunkSize i
log.WithFields(logrus.Fields{
"prefix": redisLogPrefix,
}).Error("Multi command failed: ", err)
log.WithFields(logrus.Fields{
"prefix": redisLogPrefix,
}).Error("Records lost: ", len(lrange.Val()))
r.Connect()
}

vals := lrange.Val()

result := make([]interface{}, len(vals))
for i, v := range vals {
unpacking:
for i := 0; i < len(result); i++ {
v := ""
for v == "" {
if len(vals) == 0 {
result = result[:i]
break unpacking
}
v = vals[0]
vals = vals[1:]
}
result[i] = v
}

Expand Down

0 comments on commit e23cc7f

Please sign in to comment.