chore: 按时间切换基建配置不在任务运行中或任务开始前切换

fix #14060
This commit is contained in:
uye
2025-09-11 15:41:12 +08:00
parent 7144821351
commit 5a25cf70a9

View File

@@ -590,7 +590,7 @@ public class InfrastSettingsUserControlModel : TaskViewModel
{
if (InfrastMode != Mode.Custom ||
!_customInfrastPlanHasPeriod ||
Instances.AsstProxy.TasksStatus.FirstOrDefault(i => i.Value.Type == AsstProxy.TaskType.Infrast).Value.Status == TaskStatus.InProgress)
Instances.AsstProxy.TasksStatus.FirstOrDefault(i => i.Value.Type == AsstProxy.TaskType.Infrast).Value.Status != TaskStatus.Completed)
{
return;
}
@@ -598,8 +598,8 @@ public class InfrastSettingsUserControlModel : TaskViewModel
var now = DateTime.Now;
foreach (var plan in CustomInfrastPlanInfoList.Where(
plan => plan.PeriodList.Any(
period => TimeLess(period.BeginHour, period.BeginMinute, now.Hour, now.Minute)
&& TimeLess(now.Hour, now.Minute, period.EndHour, period.EndMinute))))
period => TimeLess(period.BeginHour, period.BeginMinute, now.Hour, now.Minute) &&
TimeLess(now.Hour, now.Minute, period.EndHour, period.EndMinute))))
{
CustomInfrastPlanIndex = plan.Index;
return;