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;
|
||||
if (recurring && recurrenceTime is null)
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -130,13 +130,13 @@ public class JobBoss : GlobalBase
|
||||
foreach (Queue<Job> jobQueue in mangaConnectorJobQueue.Values)
|
||||
{
|
||||
Job queueHead = jobQueue.Peek();
|
||||
if (queueHead.progressToken.state == ProgressToken.State.Complete)
|
||||
if (queueHead.progressToken.state is ProgressToken.State.Complete)
|
||||
{
|
||||
if(queueHead.recurring)
|
||||
queueHead.Reset();
|
||||
jobQueue.Dequeue();
|
||||
}else if(queueHead.progressToken.state is ProgressToken.State.Standby)
|
||||
AddJobsToQueue(jobQueue.Peek().ExecuteReturnSubTasks());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user