fix: hotfix calculate next run time
This commit is contained in:
@ -45,8 +45,8 @@ public static class CronUpdateSkipService
|
||||
if (depth <= 0)
|
||||
return [];
|
||||
|
||||
currentDate ??= DateOnly.FromDateTime(DateTime.UtcNow);
|
||||
DateTimeOffset nextRunTime = currentDate.Value.ToDateTime(new TimeOnly(0, 0, 0));
|
||||
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
||||
DateTimeOffset nextRunTime = currentDate.Value.ToDateTime(TimeOnly.FromDateTime(DateTime.Now));
|
||||
|
||||
List<DateTimeOffset> result = [];
|
||||
|
||||
@ -59,7 +59,7 @@ public static class CronUpdateSkipService
|
||||
else if (lastSkip.Date.HasValue)
|
||||
nextRunTime = new DateTimeOffset(lastSkip.Date.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
||||
|
||||
var next = expression.GetNextOccurrence(nextRunTime, TimeZoneInfo.Local);
|
||||
var next = expression.GetNextOccurrence(nextRunTime.ToUniversalTime(), TimeZoneInfo.Local);
|
||||
|
||||
if (!next.HasValue)
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user