mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 05:17:30 +08:00
Update TaskKey helper to task id as string
This commit is contained in:
@@ -46,7 +46,7 @@ func ValidateQueueName(qname string) error {
|
||||
}
|
||||
|
||||
// TaskKey returns a redis key for the given task message.
|
||||
func TaskKey(qname string, id uuid.UUID) string {
|
||||
func TaskKey(qname, id string) string {
|
||||
return fmt.Sprintf("asynq:{%s}:t:%s", qname, id)
|
||||
}
|
||||
|
||||
|
@@ -17,11 +17,11 @@ import (
|
||||
)
|
||||
|
||||
func TestTaskKey(t *testing.T) {
|
||||
id := uuid.New()
|
||||
id := uuid.NewString()
|
||||
|
||||
tests := []struct {
|
||||
qname string
|
||||
id uuid.UUID
|
||||
id string
|
||||
want string
|
||||
}{
|
||||
{"default", id, fmt.Sprintf("asynq:{default}:t:%s", id)},
|
||||
|
Reference in New Issue
Block a user