Changed Job.ExecuteNow to ExecutionEnqueue
Instead of replacing progressToken, change Increments based in completed increments
This commit is contained in:
parent
51a1ae72ca
commit
c0e6da144e
@ -59,14 +59,15 @@ public abstract class Job : GlobalBase
|
||||
|
||||
public void ResetProgress()
|
||||
{
|
||||
this.progressToken = new ProgressToken(this.progressToken.increments);
|
||||
this.progressToken.increments = this.progressToken.increments - this.progressToken.incrementsCompleted;
|
||||
this.lastExecution = DateTime.Now;
|
||||
}
|
||||
|
||||
public void ExecuteNow()
|
||||
public void ExecutionEnqueue()
|
||||
{
|
||||
ResetProgress();
|
||||
this.lastExecution = DateTime.UnixEpoch;
|
||||
this.progressToken.increments = this.progressToken.increments - this.progressToken.incrementsCompleted;
|
||||
this.lastExecution = recurrenceTime is not null ? DateTime.Now.Subtract((TimeSpan)recurrenceTime) : DateTime.UnixEpoch;
|
||||
this.progressToken.Standby();
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
|
@ -130,7 +130,7 @@ public class JobBoss : GlobalBase
|
||||
Queue<Job> connectorJobQueue = mangaConnectorJobQueue[job.mangaConnector];
|
||||
if(!connectorJobQueue.Contains(job))
|
||||
connectorJobQueue.Enqueue(job);
|
||||
job.ExecuteNow();
|
||||
job.ExecutionEnqueue();
|
||||
}
|
||||
|
||||
public void AddJobsToQueue(IEnumerable<Job> jobs)
|
||||
|
Loading…
Reference in New Issue
Block a user