2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-26 07:42:17 +08:00

Fix bug in RDB.memoryUsage

This commit is contained in:
Ken Hibino 2021-04-04 12:49:19 -07:00
parent 8b997d2fab
commit 544c301a8b

View File

@ -172,10 +172,14 @@ func (r *RDB) CurrentStats(qname string) (*Stats, error) {
}
func (r *RDB) memoryUsage(qname string) (int64, error) {
var cursor uint64
var keys []string
var (
keys []string
data []string
cursor uint64
err error
)
for {
data, cursor, err := r.client.Scan(cursor, fmt.Sprintf("asynq:{%s}*", qname), 100).Result()
data, cursor, err = r.client.Scan(cursor, fmt.Sprintf("asynq:{%s}*", qname), 100).Result()
if err != nil {
return 0, err
}