CheckJobs combined cancelled and completed checks,
added standby check
This commit is contained in:
parent
22c4c0eb2c
commit
14ba71005f
@ -165,16 +165,7 @@ public class JobBoss : GlobalBase
|
||||
if(jobQueue.Count < 1)
|
||||
continue;
|
||||
Job queueHead = jobQueue.Peek();
|
||||
if (queueHead.progressToken.state is ProgressToken.State.Complete)
|
||||
{
|
||||
if(queueHead.recurring)
|
||||
queueHead.ResetProgress();
|
||||
jobQueue.Dequeue();
|
||||
}else if (queueHead.progressToken.state is ProgressToken.State.Standby)
|
||||
{
|
||||
AddJobsToQueue(jobQueue.Peek().ExecuteReturnSubTasks());
|
||||
}
|
||||
else if (queueHead.progressToken.state is ProgressToken.State.Cancelled)
|
||||
if (queueHead.progressToken.state is ProgressToken.State.Complete or ProgressToken.State.Cancelled)
|
||||
{
|
||||
switch (queueHead)
|
||||
{
|
||||
@ -187,6 +178,11 @@ public class JobBoss : GlobalBase
|
||||
break;
|
||||
}
|
||||
jobQueue.Dequeue();
|
||||
}else if (queueHead.progressToken.state is ProgressToken.State.Standby)
|
||||
{
|
||||
Job[] subJobs = jobQueue.Peek().ExecuteReturnSubTasks().ToArray();
|
||||
AddJobs(subJobs);
|
||||
AddJobsToQueue(subJobs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class ProgressToken
|
||||
this.cancellationRequested = false;
|
||||
this.increments = increments;
|
||||
this.incrementsCompleted = 0;
|
||||
this.state = State.Standby;
|
||||
this.state = State.Complete;
|
||||
}
|
||||
|
||||
private float GetProgress()
|
||||
@ -32,6 +32,11 @@ public class ProgressToken
|
||||
state = State.Complete;
|
||||
}
|
||||
|
||||
public void Standby()
|
||||
{
|
||||
state = State.Standby;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
state = State.Running;
|
||||
|
Loading…
Reference in New Issue
Block a user