fix(presence): list only running agents; a finished task's agent is not stale
This commit is contained in:
2 files changed
+5
-5
No files matched your search
@@ -139,10 +139,11 @@ func Mesh(records []storecontract.Presence, now time.Time) []Service {
|
||||
if record.Service != Agent {
|
||||
continue
|
||||
}
|
||||
// An agent reports for one task and stops when the task ends, so a
|
||||
// silent agent is finished, not failed: only running agents are listed.
|
||||
worker := Service{Presence: record, State: state(record, true, now)}
|
||||
if worker.State == StateDown {
|
||||
worker.Detail = ""
|
||||
worker.Checks = nil
|
||||
continue
|
||||
}
|
||||
workers = append(workers, worker)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user