mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-16 20:00:09 +08:00
Fix RDB.AggregationCheck when run against an empty group
This commit is contained in:
@@ -1009,6 +1009,9 @@ func (r *RDB) ListGroups(qname string) ([]string, error) {
|
||||
// Returns 1 if an aggregation set was created
|
||||
var aggregationCheckCmd = redis.NewScript(`
|
||||
local size = redis.call("ZCARD", KEYS[1])
|
||||
if size == 0 then
|
||||
return 0
|
||||
end
|
||||
local maxSize = tonumber(ARGV[1])
|
||||
if size >= maxSize then
|
||||
local msgs = redis.call("ZRANGE", KEYS[1], 0, maxSize-1)
|
||||
|
Reference in New Issue
Block a user