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 {
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,
}
}

View File

@ -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
}