From 2d688dbbabe816932c73b521914bdf245ab569d4 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Sat, 19 Jun 2021 06:21:07 -0700 Subject: [PATCH] Fix build --- conversion_helpers.go | 76 +++++++++++++++++++++---------------------- task_handlers.go | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/conversion_helpers.go b/conversion_helpers.go index 2cbdd40..1208b1c 100644 --- a/conversion_helpers.go +++ b/conversion_helpers.go @@ -114,13 +114,13 @@ type ActiveTask struct { func toActiveTask(t *asynq.TaskInfo) *ActiveTask { base := &BaseTask{ - ID: t.ID(), - Type: t.Type(), - Payload: toPrintablePayload(t.Payload()), - Queue: t.Queue(), - MaxRetry: t.MaxRetry(), - Retried: t.Retried(), - LastError: t.LastErr(), + ID: t.ID, + Type: t.Type, + Payload: toPrintablePayload(t.Payload), + Queue: t.Queue, + MaxRetry: t.MaxRetry, + Retried: t.Retried, + LastError: t.LastErr, } return &ActiveTask{BaseTask: base} } @@ -140,13 +140,13 @@ type PendingTask struct { func toPendingTask(t *asynq.TaskInfo) *PendingTask { base := &BaseTask{ - ID: t.ID(), - Type: t.Type(), - Payload: toPrintablePayload(t.Payload()), - Queue: t.Queue(), - MaxRetry: t.MaxRetry(), - Retried: t.Retried(), - LastError: t.LastErr(), + ID: t.ID, + Type: t.Type, + Payload: toPrintablePayload(t.Payload), + Queue: t.Queue, + MaxRetry: t.MaxRetry, + Retried: t.Retried, + LastError: t.LastErr, } return &PendingTask{ BaseTask: base, @@ -192,17 +192,17 @@ func toPrintablePayload(payload []byte) string { func toScheduledTask(t *asynq.TaskInfo) *ScheduledTask { base := &BaseTask{ - ID: t.ID(), - Type: t.Type(), - Payload: toPrintablePayload(t.Payload()), - Queue: t.Queue(), - MaxRetry: t.MaxRetry(), - Retried: t.Retried(), - LastError: t.LastErr(), + ID: t.ID, + Type: t.Type, + Payload: toPrintablePayload(t.Payload), + Queue: t.Queue, + MaxRetry: t.MaxRetry, + Retried: t.Retried, + LastError: t.LastErr, } return &ScheduledTask{ BaseTask: base, - NextProcessAt: t.NextProcessAt(), + NextProcessAt: t.NextProcessAt, } } @@ -221,17 +221,17 @@ type RetryTask struct { func toRetryTask(t *asynq.TaskInfo) *RetryTask { base := &BaseTask{ - ID: t.ID(), - Type: t.Type(), - Payload: toPrintablePayload(t.Payload()), - Queue: t.Queue(), - MaxRetry: t.MaxRetry(), - Retried: t.Retried(), - LastError: t.LastErr(), + ID: t.ID, + Type: t.Type, + Payload: toPrintablePayload(t.Payload), + Queue: t.Queue, + MaxRetry: t.MaxRetry, + Retried: t.Retried, + LastError: t.LastErr, } return &RetryTask{ BaseTask: base, - NextProcessAt: t.NextProcessAt(), + NextProcessAt: t.NextProcessAt, } } @@ -250,17 +250,17 @@ type ArchivedTask struct { func toArchivedTask(t *asynq.TaskInfo) *ArchivedTask { base := &BaseTask{ - ID: t.ID(), - Type: t.Type(), - Payload: toPrintablePayload(t.Payload()), - Queue: t.Queue(), - MaxRetry: t.MaxRetry(), - Retried: t.Retried(), - LastError: t.LastErr(), + ID: t.ID, + Type: t.Type, + Payload: toPrintablePayload(t.Payload), + Queue: t.Queue, + MaxRetry: t.MaxRetry, + Retried: t.Retried, + LastError: t.LastErr, } return &ArchivedTask{ BaseTask: base, - LastFailedAt: t.LastFailedAt(), + LastFailedAt: t.LastFailedAt, } } diff --git a/task_handlers.go b/task_handlers.go index a589434..0339cb0 100644 --- a/task_handlers.go +++ b/task_handlers.go @@ -98,7 +98,7 @@ func newCancelAllActiveTasksHandlerFunc(inspector *asynq.Inspector) http.Handler return } for _, t := range tasks { - if err := inspector.CancelProcessing(t.ID()); err != nil { + if err := inspector.CancelProcessing(t.ID); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return }