Fix build

This commit is contained in:
Ken Hibino 2021-06-19 06:21:07 -07:00
parent 403062b556
commit 2d688dbbab
2 changed files with 39 additions and 39 deletions

View File

@ -114,13 +114,13 @@ type ActiveTask struct {
func toActiveTask(t *asynq.TaskInfo) *ActiveTask { func toActiveTask(t *asynq.TaskInfo) *ActiveTask {
base := &BaseTask{ base := &BaseTask{
ID: t.ID(), ID: t.ID,
Type: t.Type(), Type: t.Type,
Payload: toPrintablePayload(t.Payload()), Payload: toPrintablePayload(t.Payload),
Queue: t.Queue(), Queue: t.Queue,
MaxRetry: t.MaxRetry(), MaxRetry: t.MaxRetry,
Retried: t.Retried(), Retried: t.Retried,
LastError: t.LastErr(), LastError: t.LastErr,
} }
return &ActiveTask{BaseTask: base} return &ActiveTask{BaseTask: base}
} }
@ -140,13 +140,13 @@ type PendingTask struct {
func toPendingTask(t *asynq.TaskInfo) *PendingTask { func toPendingTask(t *asynq.TaskInfo) *PendingTask {
base := &BaseTask{ base := &BaseTask{
ID: t.ID(), ID: t.ID,
Type: t.Type(), Type: t.Type,
Payload: toPrintablePayload(t.Payload()), Payload: toPrintablePayload(t.Payload),
Queue: t.Queue(), Queue: t.Queue,
MaxRetry: t.MaxRetry(), MaxRetry: t.MaxRetry,
Retried: t.Retried(), Retried: t.Retried,
LastError: t.LastErr(), LastError: t.LastErr,
} }
return &PendingTask{ return &PendingTask{
BaseTask: base, BaseTask: base,
@ -192,17 +192,17 @@ func toPrintablePayload(payload []byte) string {
func toScheduledTask(t *asynq.TaskInfo) *ScheduledTask { func toScheduledTask(t *asynq.TaskInfo) *ScheduledTask {
base := &BaseTask{ base := &BaseTask{
ID: t.ID(), ID: t.ID,
Type: t.Type(), Type: t.Type,
Payload: toPrintablePayload(t.Payload()), Payload: toPrintablePayload(t.Payload),
Queue: t.Queue(), Queue: t.Queue,
MaxRetry: t.MaxRetry(), MaxRetry: t.MaxRetry,
Retried: t.Retried(), Retried: t.Retried,
LastError: t.LastErr(), LastError: t.LastErr,
} }
return &ScheduledTask{ return &ScheduledTask{
BaseTask: base, BaseTask: base,
NextProcessAt: t.NextProcessAt(), NextProcessAt: t.NextProcessAt,
} }
} }
@ -221,17 +221,17 @@ type RetryTask struct {
func toRetryTask(t *asynq.TaskInfo) *RetryTask { func toRetryTask(t *asynq.TaskInfo) *RetryTask {
base := &BaseTask{ base := &BaseTask{
ID: t.ID(), ID: t.ID,
Type: t.Type(), Type: t.Type,
Payload: toPrintablePayload(t.Payload()), Payload: toPrintablePayload(t.Payload),
Queue: t.Queue(), Queue: t.Queue,
MaxRetry: t.MaxRetry(), MaxRetry: t.MaxRetry,
Retried: t.Retried(), Retried: t.Retried,
LastError: t.LastErr(), LastError: t.LastErr,
} }
return &RetryTask{ return &RetryTask{
BaseTask: base, BaseTask: base,
NextProcessAt: t.NextProcessAt(), NextProcessAt: t.NextProcessAt,
} }
} }
@ -250,17 +250,17 @@ type ArchivedTask struct {
func toArchivedTask(t *asynq.TaskInfo) *ArchivedTask { func toArchivedTask(t *asynq.TaskInfo) *ArchivedTask {
base := &BaseTask{ base := &BaseTask{
ID: t.ID(), ID: t.ID,
Type: t.Type(), Type: t.Type,
Payload: toPrintablePayload(t.Payload()), Payload: toPrintablePayload(t.Payload),
Queue: t.Queue(), Queue: t.Queue,
MaxRetry: t.MaxRetry(), MaxRetry: t.MaxRetry,
Retried: t.Retried(), Retried: t.Retried,
LastError: t.LastErr(), LastError: t.LastErr,
} }
return &ArchivedTask{ return &ArchivedTask{
BaseTask: base, BaseTask: base,
LastFailedAt: t.LastFailedAt(), LastFailedAt: t.LastFailedAt,
} }
} }

View File

@ -98,7 +98,7 @@ func newCancelAllActiveTasksHandlerFunc(inspector *asynq.Inspector) http.Handler
return return
} }
for _, t := range tasks { 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) http.Error(w, err.Error(), http.StatusInternalServerError)
return return
} }