2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-04-22 16:50:18 +08:00

Update WorkerInfo type

This commit is contained in:
Ken Hibino 2021-04-04 12:47:38 -07:00
parent c02409c974
commit 7ba05e6a78

View File

@ -640,11 +640,10 @@ func (i *Inspector) Servers() ([]*ServerInfo, error) {
wrkInfo := &WorkerInfo{ wrkInfo := &WorkerInfo{
Started: w.Started, Started: w.Started,
Deadline: w.Deadline, Deadline: w.Deadline,
Task: &ActiveTask{ TaskID: w.ID,
Task: asynq.NewTask(w.Type, w.Payload), TaskType: w.Type,
ID: w.ID, TaskPayload: w.Payload,
Queue: w.Queue, Queue: w.Queue,
},
} }
srvInfo.ActiveWorkers = append(srvInfo.ActiveWorkers, wrkInfo) srvInfo.ActiveWorkers = append(srvInfo.ActiveWorkers, wrkInfo)
} }
@ -681,8 +680,18 @@ type ServerInfo struct {
// WorkerInfo describes a running worker processing a task. // WorkerInfo describes a running worker processing a task.
type WorkerInfo struct { type WorkerInfo struct {
// The task the worker is processing. // ID of the task the worker is processing.
Task *ActiveTask TaskID string
// Type of the task the worker is processing.
TaskType string
// Payload of the task the work is processing.
TaskPayload []byte
// Queue the worker got its task from.
Queue string
// Time the worker started processing the task. // Time the worker started processing the task.
Started time.Time Started time.Time
// Time the worker needs to finish processing the task by. // Time the worker needs to finish processing the task by.