mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-06 06:45:52 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaa3f1d4fd | ||
|
|
4722ca2d3d |
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.16.1] - 2021-03-20
|
||||
|
||||
### Fixed
|
||||
|
||||
- Replace `KEYS` command with `SCAN` as recommended by [redis doc](https://redis.io/commands/KEYS).
|
||||
|
||||
## [0.16.0] - 2021-03-10
|
||||
|
||||
### Added
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
// Version of asynq library and CLI.
|
||||
const Version = "0.16.0"
|
||||
const Version = "0.16.1"
|
||||
|
||||
// DefaultQueueName is the queue name used if none are specified by user.
|
||||
const DefaultQueueName = "default"
|
||||
|
||||
@@ -172,9 +172,17 @@ func (r *RDB) CurrentStats(qname string) (*Stats, error) {
|
||||
}
|
||||
|
||||
func (r *RDB) memoryUsage(qname string) (int64, error) {
|
||||
keys, err := r.client.Keys(fmt.Sprintf("asynq:{%s}*", qname)).Result()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
var cursor uint64
|
||||
var keys []string
|
||||
for {
|
||||
data, cursor, err := r.client.Scan(cursor, fmt.Sprintf("asynq:{%s}*", qname), 100).Result()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
keys = append(keys, data...)
|
||||
if cursor == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
var usg int64
|
||||
for _, k := range keys {
|
||||
|
||||
Reference in New Issue
Block a user