MCPcopy Index your code
hub / github.com/coder/coder / toStatusRow

Function toStatusRow

cli/task_status.go:169–184  ·  view source on GitHub ↗
(task codersdk.Task, now time.Time)

Source from the content-addressed store, hash-verified

167}
168
169func 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
186func taskStateEqual(se1, se2 *codersdk.TaskStateEntry) bool {
187 var s1, m1, s2, m2 string

Callers 1

taskStatusMethod · 0.85

Calls 3

ShuttingDownMethod · 0.80
StringMethod · 0.45
StartingMethod · 0.45

Tested by

no test coverage detected