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:
parent
c02409c974
commit
7ba05e6a78
@ -638,13 +638,12 @@ func (i *Inspector) Servers() ([]*ServerInfo, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user