refactor: use default pairPeriod
This commit is contained in:
@ -294,7 +294,16 @@ public class SetupController(
|
||||
// every 6 hours
|
||||
CronUpdateSchedule = request.CronUpdateSchedule ?? "0 */6 * * *",
|
||||
StartTerm = request.StartTerm,
|
||||
PairPeriod = request.PairPeriod.ConvertFromDto()
|
||||
PairPeriod = new Dictionary<int, ScheduleSettings.PairPeriodTime>
|
||||
{
|
||||
{1, new ScheduleSettings.PairPeriodTime(new TimeOnly(9, 0, 0), new TimeOnly(10, 30, 0))},
|
||||
{2, new ScheduleSettings.PairPeriodTime(new TimeOnly(10, 40, 0), new TimeOnly(12, 10, 0))},
|
||||
{3, new ScheduleSettings.PairPeriodTime(new TimeOnly(12, 40, 0), new TimeOnly(14, 10, 0))},
|
||||
{4, new ScheduleSettings.PairPeriodTime(new TimeOnly(14, 20, 0), new TimeOnly(15, 50, 0))},
|
||||
{5, new ScheduleSettings.PairPeriodTime(new TimeOnly(16, 20, 0), new TimeOnly(17, 50, 0))},
|
||||
{6, new ScheduleSettings.PairPeriodTime(new TimeOnly(18, 0, 0), new TimeOnly(19, 30, 0))},
|
||||
{7, new ScheduleSettings.PairPeriodTime(new TimeOnly(19, 40, 0), new TimeOnly(21, 10, 0))},
|
||||
}
|
||||
};
|
||||
|
||||
if (!CronExpression.TryParse(general.ScheduleSettings.CronUpdateSchedule, CronFormat.Standard, out _))
|
||||
|
Reference in New Issue
Block a user