appStatusStateToTaskState converts a WorkspaceAppStatusState to a TaskState. The two enums mostly share values but "failure" in the app status maps to "failed" in the public task API.
(s codersdk.WorkspaceAppStatusState)
| 318 | // TaskState. The two enums mostly share values but "failure" in the |
| 319 | // app status maps to "failed" in the public task API. |
| 320 | func appStatusStateToTaskState(s codersdk.WorkspaceAppStatusState) codersdk.TaskState { |
| 321 | switch s { |
| 322 | case codersdk.WorkspaceAppStatusStateFailure: |
| 323 | return codersdk.TaskStateFailed |
| 324 | default: |
| 325 | return codersdk.TaskState(s) |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | // deriveTaskCurrentState determines the current state of a task based on the |
| 330 | // workspace's latest app status and initialization phase. |
no test coverage detected