
Fix most linter warnings reported by 'staticcheck'. This doesn't fix all of them, some unused functions are still there, and some generated code also still triggers some warnings. Most issues are fixed, though. No functional changes, except for the captialisation of some error messages.
21 lines
701 B
Go
21 lines
701 B
Go
package task_state_machine
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import "projects.blender.org/studio/flamenco/pkg/api"
|
|
|
|
var (
|
|
// 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]
|
|
}
|