mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 13:21:58 +08:00
Rename pending key
This commit is contained in:
@@ -25,7 +25,7 @@ const Version = "0.16.0"
|
||||
const DefaultQueueName = "default"
|
||||
|
||||
// DefaultQueue is the redis key for the default queue.
|
||||
var DefaultQueue = QueueKey(DefaultQueueName)
|
||||
var DefaultQueue = PendingKey(DefaultQueueName)
|
||||
|
||||
// Global Redis keys.
|
||||
const (
|
||||
@@ -45,9 +45,9 @@ func ValidateQueueName(qname string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueueKey returns a redis key for the given queue name.
|
||||
func QueueKey(qname string) string {
|
||||
return fmt.Sprintf("asynq:{%s}", qname)
|
||||
// PendingKey returns a redis key for the given queue name.
|
||||
func PendingKey(qname string) string {
|
||||
return fmt.Sprintf("asynq:{%s}:pending", qname)
|
||||
}
|
||||
|
||||
// ActiveKey returns a redis key for the active tasks.
|
||||
|
@@ -25,7 +25,7 @@ func TestQueueKey(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
got := QueueKey(tc.qname)
|
||||
got := PendingKey(tc.qname)
|
||||
if got != tc.want {
|
||||
t.Errorf("QueueKey(%q) = %q, want %q", tc.qname, got, tc.want)
|
||||
}
|
||||
|
Reference in New Issue
Block a user