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)
|
if(jobQueue.Count < 1)
|
||||||
continue;
|
continue;
|
||||||
Job queueHead = jobQueue.Peek();
|
Job queueHead = jobQueue.Peek();
|
||||||
if (queueHead.progressToken.state is ProgressToken.State.Complete)
|
if (queueHead.progressToken.state is ProgressToken.State.Complete or ProgressToken.State.Cancelled)
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
switch (queueHead)
|
switch (queueHead)
|
||||||
{
|
{
|
||||||
@ -187,6 +178,11 @@ public class JobBoss : GlobalBase
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
jobQueue.Dequeue();
|
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.cancellationRequested = false;
|
||||||
this.increments = increments;
|
this.increments = increments;
|
||||||
this.incrementsCompleted = 0;
|
this.incrementsCompleted = 0;
|
||||||
this.state = State.Standby;
|
this.state = State.Complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
private float GetProgress()
|
private float GetProgress()
|
||||||
@ -32,6 +32,11 @@ public class ProgressToken
|
|||||||
state = State.Complete;
|
state = State.Complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Standby()
|
||||||
|
{
|
||||||
|
state = State.Standby;
|
||||||
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
state = State.Running;
|
state = State.Running;
|
||||||
|
Loading…
Reference in New Issue
Block a user