mirror of
https://github.com/hibiken/asynq.git
synced 2026-05-12 13:00:06 +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]
|
## [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
|
## [0.16.0] - 2021-03-10
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Version of asynq library and CLI.
|
// 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.
|
// DefaultQueueName is the queue name used if none are specified by user.
|
||||||
const DefaultQueueName = "default"
|
const DefaultQueueName = "default"
|
||||||
|
|||||||
@@ -172,9 +172,17 @@ func (r *RDB) CurrentStats(qname string) (*Stats, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *RDB) memoryUsage(qname string) (int64, error) {
|
func (r *RDB) memoryUsage(qname string) (int64, error) {
|
||||||
keys, err := r.client.Keys(fmt.Sprintf("asynq:{%s}*", qname)).Result()
|
var cursor uint64
|
||||||
if err != nil {
|
var keys []string
|
||||||
return 0, err
|
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
|
var usg int64
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
|
|||||||
Reference in New Issue
Block a user