Sybren A. Stüvel 02fac6a4df Change Go package name from git.blender.org to projects.blender.org
Change the package base name of the Go code, from
`git.blender.org/flamenco` to `projects.blender.org/studio/flamenco`.

The old location, `git.blender.org`, has no longer been use since the
[migration to Gitea][1]. The new package names now reflect the actual
location where Flamenco is hosted.

[1]: https://code.blender.org/2023/02/new-blender-development-infrastructure/
2023-08-01 12:42:31 +02:00

29 lines
920 B
Go

package task_state_machine
// SPDX-License-Identifier: GPL-3.0-or-later
import "projects.blender.org/studio/flamenco/pkg/api"
var (
// Task statuses that always get requeued when the job is requeueing.
nonCompletedStatuses = []api.TaskStatus{
api.TaskStatusCanceled,
api.TaskStatusFailed,
api.TaskStatusPaused,
api.TaskStatusSoftFailed,
}
// Workers are allowed to keep running tasks when they are in this status.
// 'queued', 'claimed-by-manager', and 'soft-failed' aren't considered runnable,
// as those statuses indicate the task wasn't assigned to a Worker by the scheduler.
runnableStatuses = map[api.TaskStatus]bool{
api.TaskStatusActive: true,
}
)
// IsRunnableTaskStatus returns whether the given status is considered "runnable".
// In other words, workers are allowed to keep running such tasks.
func IsRunnableTaskStatus(status api.TaskStatus) bool {
return runnableStatuses[status]
}