Fixed jobs not starting at all
This commit is contained in:
parent
0552b3db82
commit
eaab7c5235
@ -19,6 +19,8 @@ public abstract class Job : GlobalBase
|
|||||||
this.recurring = recurring;
|
this.recurring = recurring;
|
||||||
if (recurring && recurrenceTime is null)
|
if (recurring && recurrenceTime is null)
|
||||||
throw new ArgumentException("If recurrence is set to true, a recurrence time has to be provided.");
|
throw new ArgumentException("If recurrence is set to true, a recurrence time has to be provided.");
|
||||||
|
else if(recurring && recurrenceTime is not null)
|
||||||
|
this.lastExecution = DateTime.Now.Subtract((TimeSpan)recurrenceTime);
|
||||||
this.recurrenceTime = recurrenceTime;
|
this.recurrenceTime = recurrenceTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,13 +130,13 @@ public class JobBoss : GlobalBase
|
|||||||
foreach (Queue<Job> jobQueue in mangaConnectorJobQueue.Values)
|
foreach (Queue<Job> jobQueue in mangaConnectorJobQueue.Values)
|
||||||
{
|
{
|
||||||
Job queueHead = jobQueue.Peek();
|
Job queueHead = jobQueue.Peek();
|
||||||
if (queueHead.progressToken.state == ProgressToken.State.Complete)
|
if (queueHead.progressToken.state is ProgressToken.State.Complete)
|
||||||
{
|
{
|
||||||
if(queueHead.recurring)
|
if(queueHead.recurring)
|
||||||
queueHead.Reset();
|
queueHead.Reset();
|
||||||
jobQueue.Dequeue();
|
jobQueue.Dequeue();
|
||||||
|
}else if(queueHead.progressToken.state is ProgressToken.State.Standby)
|
||||||
AddJobsToQueue(jobQueue.Peek().ExecuteReturnSubTasks());
|
AddJobsToQueue(jobQueue.Peek().ExecuteReturnSubTasks());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user