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
@ -640,11 +640,10 @@ func (i *Inspector) Servers() ([]*ServerInfo, error) {
|
||||
wrkInfo := &WorkerInfo{
|
||||
Started: w.Started,
|
||||
Deadline: w.Deadline,
|
||||
Task: &ActiveTask{
|
||||
Task: asynq.NewTask(w.Type, w.Payload),
|
||||
ID: w.ID,
|
||||
TaskID: w.ID,
|
||||
TaskType: w.Type,
|
||||
TaskPayload: w.Payload,
|
||||
Queue: w.Queue,
|
||||
},
|
||||
}
|
||||
srvInfo.ActiveWorkers = append(srvInfo.ActiveWorkers, wrkInfo)
|
||||
}
|
||||
@ -681,8 +680,18 @@ type ServerInfo struct {
|
||||
|
||||
// WorkerInfo describes a running worker processing a task.
|
||||
type WorkerInfo struct {
|
||||
// The task the worker is processing.
|
||||
Task *ActiveTask
|
||||
// ID of the task the worker is processing.
|
||||
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.
|
||||
Started time.Time
|
||||
// Time the worker needs to finish processing the task by.
|
||||
|
Loading…
x
Reference in New Issue
Block a user