2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-08-19 15:08:55 +08:00

Record deadline within WorkerInfo

This commit is contained in:
Ken Hibino
2021-01-27 15:55:43 -08:00
parent bfde0b6283
commit eba7c4e085
9 changed files with 40 additions and 30 deletions

View File

@@ -974,7 +974,6 @@ func (r *RDB) ListWorkers() ([]*base.WorkerInfo, error) {
continue // skip bad data
}
workers = append(workers, &w)
}
}
return workers, nil

View File

@@ -2966,6 +2966,7 @@ func TestListWorkers(t *testing.T) {
Queue: m1.Queue,
Payload: m1.Payload,
Started: time.Now().Add(-1 * time.Second),
Deadline: time.Now().Add(30 * time.Second),
},
{
Host: host,
@@ -2976,6 +2977,7 @@ func TestListWorkers(t *testing.T) {
Queue: m2.Queue,
Payload: m2.Payload,
Started: time.Now().Add(-5 * time.Second),
Deadline: time.Now().Add(10 * time.Minute),
},
{
Host: host,
@@ -2986,6 +2988,7 @@ func TestListWorkers(t *testing.T) {
Queue: m3.Queue,
Payload: m3.Payload,
Started: time.Now().Add(-30 * time.Second),
Deadline: time.Now().Add(30 * time.Minute),
},
},
},