Allow background tasks return results that are included in the event

This commit is contained in:
eikek
2022-02-09 23:38:32 +01:00
parent b76fa52d67
commit d6829ea69b
5 changed files with 60 additions and 39 deletions

View File

@ -54,6 +54,9 @@ object JobState {
NonEmptyList.of(Waiting, Scheduled, Running, Stuck)
val inProgress: Set[JobState] = Set(Scheduled, Running, Stuck)
def isDone(state: JobState): Boolean =
done.exists(_ == state)
def parse(str: String): Either[String, JobState] =
str.toLowerCase match {
case "waiting" => Right(Waiting)