From e63a5d4f3b8846fea252fe3c1f3c4d232fc2e8fd Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Thu, 21 Jan 2021 06:47:56 -0800 Subject: [PATCH] Add Key field to PendingTask --- conversion_helpers.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conversion_helpers.go b/conversion_helpers.go index 45c9920..905559d 100644 --- a/conversion_helpers.go +++ b/conversion_helpers.go @@ -111,6 +111,7 @@ func toActiveTasks(in []*asynq.ActiveTask) []*ActiveTask { type PendingTask struct { *BaseTask + Key string `json:"key"` } func toPendingTask(t *asynq.PendingTask) *PendingTask { @@ -120,7 +121,10 @@ func toPendingTask(t *asynq.PendingTask) *PendingTask { Payload: t.Payload, Queue: t.Queue, } - return &PendingTask{base} + return &PendingTask{ + BaseTask: base, + Key: t.Key(), + } } func toPendingTasks(in []*asynq.PendingTask) []*PendingTask {