Compare commits
2 Commits
ea4c8b61e0
...
e79ec360ea
Author | SHA1 | Date | |
---|---|---|---|
e79ec360ea | |||
31c1d2804d |
@ -37,7 +37,7 @@ public static class CronUpdateSkipService
|
|||||||
.OrderBy(x => x.End ?? x.Date)
|
.OrderBy(x => x.End ?? x.Date)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<DateTimeOffset> GetNextTask(this List<ScheduleSettings.CronUpdateSkip> data,
|
public static List<DateTimeOffset> GetNextTask(this List<ScheduleSettings.CronUpdateSkip> data,
|
||||||
CronExpression expression, int depth = 1, DateOnly? currentDate = null)
|
CronExpression expression, int depth = 1, DateOnly? currentDate = null)
|
||||||
@ -45,8 +45,8 @@ public static class CronUpdateSkipService
|
|||||||
if (depth <= 0)
|
if (depth <= 0)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
currentDate ??= DateOnly.FromDateTime(DateTime.UtcNow);
|
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
||||||
DateTimeOffset nextRunTime = currentDate.Value.ToDateTime(new TimeOnly(0, 0, 0));
|
DateTimeOffset nextRunTime = currentDate.Value.ToDateTime(TimeOnly.FromDateTime(DateTime.Now));
|
||||||
|
|
||||||
List<DateTimeOffset> result = [];
|
List<DateTimeOffset> result = [];
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ public static class CronUpdateSkipService
|
|||||||
else if (lastSkip.Date.HasValue)
|
else if (lastSkip.Date.HasValue)
|
||||||
nextRunTime = new DateTimeOffset(lastSkip.Date.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
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)
|
if (!next.HasValue)
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user