2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-08-19 15:08:55 +08:00

Replace github.com/rs/xid with github.com/google/uuid

This commit is contained in:
Ken Hibino
2020-07-02 06:21:20 -07:00
parent 486dcd799b
commit 8b60e6a268
15 changed files with 104 additions and 108 deletions

View File

@@ -14,7 +14,7 @@ import (
"time"
"github.com/go-redis/redis/v7"
"github.com/rs/xid"
"github.com/google/uuid"
)
// Version of asynq library and CLI.
@@ -78,7 +78,7 @@ type TaskMessage struct {
Payload map[string]interface{}
// ID is a unique identifier for each task.
ID xid.ID
ID uuid.UUID
// Queue is a name this message should be enqueued to.
Queue string

View File

@@ -12,7 +12,7 @@ import (
"time"
"github.com/google/go-cmp/cmp"
"github.com/rs/xid"
"github.com/google/uuid"
)
func TestQueueKey(t *testing.T) {
@@ -108,7 +108,7 @@ func TestWorkersKey(t *testing.T) {
}
func TestMessageEncoding(t *testing.T) {
id := xid.New()
id := uuid.New()
tests := []struct {
in *TaskMessage
out *TaskMessage