Fixed jobs not starting at all

This commit is contained in:
2023-09-01 23:08:31 +02:00
parent 0552b3db82
commit eaab7c5235
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}