diff --git a/internal/rdb/rdb.go b/internal/rdb/rdb.go index d200517b..7bb10c8f 100644 --- a/internal/rdb/rdb.go +++ b/internal/rdb/rdb.go @@ -1284,7 +1284,10 @@ local res = {} local ids = redis.call("ZRANGEBYSCORE", KEYS[1], "-inf", ARGV[1]) for _, id in ipairs(ids) do local key = ARGV[2] .. id - table.insert(res, redis.call("HGET", key, "msg")) + local v = redis.call("HGET", key, "msg") + if v then + table.insert(res, v) + end end return res `) @@ -1305,9 +1308,6 @@ func (r *RDB) ListLeaseExpired(cutoff time.Time, qnames ...string) ([]*base.Task return nil, errors.E(op, errors.Internal, fmt.Sprintf("cast error: Lua script returned unexpected value: %v", res)) } for _, s := range data { - if len(s) == 0 { - continue - } msg, err := base.DecodeMessage([]byte(s)) if err != nil { return nil, errors.E(op, errors.Internal, fmt.Sprintf("cannot decode message: %v", err))