Update RDB.ListDeadlineExceeded

This commit is contained in:
Ken Hibino
2021-02-23 14:44:59 -08:00
parent 5105f35697
commit ec9fd6b577
3 changed files with 28 additions and 10 deletions

View File

@@ -45,9 +45,14 @@ func ValidateQueueName(qname string) error {
return nil
}
// TaskKeyPrefix returns a prefix for task key.
func TaskKeyPrefix(qname string) string {
return fmt.Sprintf("asynq:{%s}:t:", qname)
}
// TaskKey returns a redis key for the given task message.
func TaskKey(qname, id string) string {
return fmt.Sprintf("asynq:{%s}:t:%s", qname, id)
return fmt.Sprintf("%s%s", TaskKeyPrefix(qname), id)
}
// PendingKey returns a redis key for the given queue name.

View File

@@ -40,8 +40,8 @@ func TestQueueKey(t *testing.T) {
qname string
want string
}{
{"default", "asynq:{default}"},
{"custom", "asynq:{custom}"},
{"default", "asynq:{default}:pending"},
{"custom", "asynq:{custom}:pending"},
}
for _, tc := range tests {