(task codersdk.Task, now time.Time)
| 167 | } |
| 168 | |
| 169 | func toStatusRow(task codersdk.Task, now time.Time) taskStatusRow { |
| 170 | tsr := taskStatusRow{ |
| 171 | Task: task, |
| 172 | ChangedAgo: now.Sub(task.UpdatedAt).Truncate(time.Second).String() + " ago", |
| 173 | } |
| 174 | tsr.Healthy = task.WorkspaceAgentHealth != nil && |
| 175 | task.WorkspaceAgentHealth.Healthy && |
| 176 | task.WorkspaceAgentLifecycle != nil && |
| 177 | !task.WorkspaceAgentLifecycle.Starting() && |
| 178 | !task.WorkspaceAgentLifecycle.ShuttingDown() |
| 179 | |
| 180 | if task.CurrentState != nil { |
| 181 | tsr.ChangedAgo = now.Sub(task.CurrentState.Timestamp).Truncate(time.Second).String() + " ago" |
| 182 | } |
| 183 | return tsr |
| 184 | } |
| 185 | |
| 186 | func taskStateEqual(se1, se2 *codersdk.TaskStateEntry) bool { |
| 187 | var s1, m1, s2, m2 string |
no test coverage detected