feat(templateActivator): добавлена возможность деактивации всех расписаний, у которых шаблоны синхронизированы с ошибкой
This commit is contained in:
@@ -73,6 +73,15 @@ internal class TemplateActivator : ITemplateActivator
|
||||
query = query.Where(t => !t.IsActiveTemplate && t.IsActiveSchedule);
|
||||
changes = await UpdateScheduleStateAsync(query, false);
|
||||
break;
|
||||
case TemplateActivatorActionsEnum.DeactivateSchedulesWithTemplateSyncErrors:
|
||||
logger.LogInformation($"Получен запрос на деактивацию всех расписаний, у которых шаблоны синхронизированы с ошибкой");
|
||||
query = query.Where(t => !t.IsActiveTemplate &&
|
||||
t.RobotConfigurations.Any(t =>
|
||||
t.RobotCode == (int) RobotsEnum.TemplateOrder &&
|
||||
t.RobotStatusCode == (int)RobotStatusEnum.Error)
|
||||
);
|
||||
changes = await UpdateScheduleStateAsync(query, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,16 @@ public static class TemplateActivatorInstaller
|
||||
services.AddTransient<IMqTemplateActivator, MqTemplateActivator>();
|
||||
services.AddTransient<IValidatorService, ValidatorService>();
|
||||
}
|
||||
|
||||
public static IConfigurationBuilder AddTemplateActivatorConfigurations(this IConfigurationBuilder builder, IServiceCollection services)
|
||||
{
|
||||
builder.AddDalConfigurations(services);
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static void AddTemplateActivatorSettings(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
services.AddDallSettings(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user