From: Mateusz Warowny Date: Thu, 22 Jun 2023 13:28:58 +0000 (+0200) Subject: JAL-4199 Initialize jobs and tasks with status CREATED X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d34b7142d47cab72ca9e0822b4407f3f497f191a;p=jalview.git JAL-4199 Initialize jobs and tasks with status CREATED --- diff --git a/src/jalview/ws2/actions/AbstractPollableTask.java b/src/jalview/ws2/actions/AbstractPollableTask.java index e692c68..b61711c 100644 --- a/src/jalview/ws2/actions/AbstractPollableTask.java +++ b/src/jalview/ws2/actions/AbstractPollableTask.java @@ -49,7 +49,7 @@ public abstract class AbstractPollableTask implements Task private final TaskEventSupport eventHandler; - protected JobStatus taskStatus = null; + protected JobStatus taskStatus = JobStatus.CREATED; private Future future = null; diff --git a/src/jalview/ws2/actions/BaseJob.java b/src/jalview/ws2/actions/BaseJob.java index 945c7b0..8376d20 100644 --- a/src/jalview/ws2/actions/BaseJob.java +++ b/src/jalview/ws2/actions/BaseJob.java @@ -31,7 +31,7 @@ public abstract class BaseJob implements JobI protected final List inputSeqs; - protected JobStatus status = null; + protected JobStatus status = JobStatus.CREATED; protected String log = ""; diff --git a/src/jalview/ws2/api/JobStatus.java b/src/jalview/ws2/api/JobStatus.java index 3341a69..8957343 100644 --- a/src/jalview/ws2/api/JobStatus.java +++ b/src/jalview/ws2/api/JobStatus.java @@ -2,6 +2,8 @@ package jalview.ws2.api; public enum JobStatus { + /** Initial status before the job is started. */ + CREATED, /** Job has invalid inputs and cannot be started. */ INVALID, /** Job is created and ready for submission. */ @@ -39,6 +41,7 @@ public enum JobStatus case CANCELLED: case SERVER_ERROR: return true; + case CREATED: case READY: case SUBMITTED: case QUEUED: @@ -60,6 +63,7 @@ public enum JobStatus JobStatus.UNKNOWN, // unknown prevents successful completion but not // running or failure JobStatus.READY, + JobStatus.CREATED, JobStatus.SUBMITTED, JobStatus.QUEUED, JobStatus.RUNNING,