2
0

small improvements

This commit is contained in:
glax 2023-09-19 19:57:35 +02:00
parent 2553a150d1
commit f5b6b1785f
2 changed files with 3 additions and 3 deletions

View File

@ -59,13 +59,13 @@ public abstract class Job : GlobalBase
public void ResetProgress()
{
this.progressToken.increments = this.progressToken.increments - this.progressToken.incrementsCompleted;
this.progressToken.increments -= progressToken.incrementsCompleted;
this.lastExecution = DateTime.Now;
}
public void ExecutionEnqueue()
{
this.progressToken.increments = this.progressToken.increments - this.progressToken.incrementsCompleted;
this.progressToken.increments -= progressToken.incrementsCompleted;
this.lastExecution = recurrenceTime is not null ? DateTime.Now.Subtract((TimeSpan)recurrenceTime) : DateTime.UnixEpoch;
this.progressToken.Standby();
}

View File

@ -223,7 +223,7 @@ public class JobBoss : GlobalBase
queueHead.ResetProgress();
jobQueue.Dequeue();
ExportJobsList();
Log($"Next job in {jobs.MinBy(job => job.nextExecution)?.nextExecution.Subtract(DateTime.Now)}");
Log($"Next job in {jobs.MinBy(job => job.nextExecution)?.nextExecution.Subtract(DateTime.Now)} {jobs.MinBy(job => job.nextExecution)?.id}");
}else if (queueHead.progressToken.state is ProgressToken.State.Standby)
{
Job[] subJobs = jobQueue.Peek().ExecuteReturnSubTasks().ToArray();