mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-20 13:15:51 +08:00
MEMORY USAGE returns nil for keys that no longer exist (e.g., expired or deleted task keys). In Lua, nil is converted to false (a boolean). The script then attempts arithmetic on this boolean value, causing: ERR user_script:30: attempt to perform arithmetic on local 'bytes' (a boolean value) This breaks the /api/queues endpoint in asynqmon, showing "Could not retrieve queues live data" in the UI. The fix adds nil guards around all three MEMORY USAGE calls on task keys, and a divide-by-zero guard on agg_task_sample_size. Tested in production with Redis 7.2 and asynq v0.25.1 worker. Fixes #728 Related to #901