diff --git a/cmd/lotus-storage-miner/sealing.go b/cmd/lotus-storage-miner/sealing.go index 3507ecf16..59444d0d2 100644 --- a/cmd/lotus-storage-miner/sealing.go +++ b/cmd/lotus-storage-miner/sealing.go @@ -187,10 +187,12 @@ var sealingJobsCmd = &cli.Command{ for _, l := range lines { state := "running" - if l.RunWait > 0 { + switch { + case l.RunWait > 0: state = fmt.Sprintf("assigned(%d)", l.RunWait-1) - } - if l.RunWait == -1 { + case l.RunWait == -2: + state = "returned" + case l.RunWait == -1: state = "ret-wait" } dur := "n/a" diff --git a/extern/sector-storage/stats.go b/extern/sector-storage/stats.go index f1b47ee3c..f72f11337 100644 --- a/extern/sector-storage/stats.go +++ b/extern/sector-storage/stats.go @@ -72,11 +72,16 @@ func (m *Manager) WorkerJobs() map[uuid.UUID][]storiface.WorkerJob { log.Errorf("WorkerJobs: get work %s: %+v", work, err) } + wait := -1 + if _, ok := m.results[work]; ok { + wait = -2 // mark as returned instead of ret-wait + } + out[uuid.UUID{}] = append(out[uuid.UUID{}], storiface.WorkerJob{ ID: id, Sector: id.Sector, Task: work.Method, - RunWait: -1, + RunWait: wait, Start: time.Unix(ws.StartTime, 0), Hostname: ws.WorkerHostname, }) diff --git a/extern/sector-storage/storiface/worker.go b/extern/sector-storage/storiface/worker.go index b678d44d6..8c9982299 100644 --- a/extern/sector-storage/storiface/worker.go +++ b/extern/sector-storage/storiface/worker.go @@ -46,7 +46,7 @@ type WorkerJob struct { Sector abi.SectorID Task sealtasks.TaskType - RunWait int // -1 - ret-wait, 0 - running, 1+ - assigned + RunWait int // -2 - returned, -1 - ret-wait, 0 - running, 1+ - assigned Start time.Time Hostname string `json:",omitempty"` // optional, set for ret-wait jobs