diff --git a/PARR.AIHITLoaderWorker/Dockerfile b/PARR.AIHITLoaderWorker/Dockerfile
index 202b222c..9b499f48 100644
--- a/PARR.AIHITLoaderWorker/Dockerfile
+++ b/PARR.AIHITLoaderWorker/Dockerfile
@@ -27,12 +27,14 @@ FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
-# Понижаем уровень безопасности OpenSSL до уровня 1 и разрешаем TLSv1
-#RUN sed -i 's/CipherString = DEFAULT:@SECLEVEL=2/CipherString = DEFAULT:@SECLEVEL=1/g' /etc/ssl/openssl.cnf && \
-# sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1/g' /etc/ssl/openssl.cnf
+# 1. Принудительно настраиваем OpenSSL 3 на игнорирование непредвиденных EOF (UnsafeLegacyRenegotiation и IgnoreUnexpectedEOF)
+RUN sed -i 's/providers = provider_sect/providers = provider_sect\nssl_conf = ssl_sect/' /etc/ssl/openssl.cnf \
+ && printf "\n[ssl_sect]\nsystem_default = system_default_sect\n" >> /etc/ssl/openssl.cnf \
+ && printf "\n[system_default_sect]\nOptions = UnsafeLegacyRenegotiation,IgnoreUnexpectedEOF\nMinProtocol = TLSv1\nCipherString = DEFAULT@SECLEVEL=0\n" >> /etc/ssl/openssl.cnf
+# 2. Оставляем глобальные переменные совместимости для самого рантайма .NET 9
+ENV DOTNET_AppContext_Switch_System_Net_Security_UseUnsafeOldTlsRuntimeBehavior=true
+ENV DOTNET_AppContext_Switch_Microsoft_Data_SqlClient_UseOldTlsValue=true
ENV DOTNET_SYSTEM_NET_SECURITY_ALLOWUNSECUREDEFAULTS=true
-ENV OPENSSL_SYSTEM_DEFAULT_MIN_PROTOCOL=TLSv1
-ENV OPENSSL_SYSTEM_DEFAULT_CIPHER_STRING=DEFAULT@SECLEVEL=0
ENTRYPOINT ["dotnet", "PARR.AIHITLoaderWorker.dll"]
\ No newline at end of file
diff --git a/PARR.AIHITLoaderWorker/appsettings.json b/PARR.AIHITLoaderWorker/appsettings.json
index 6c506ebb..c4a36a17 100644
--- a/PARR.AIHITLoaderWorker/appsettings.json
+++ b/PARR.AIHITLoaderWorker/appsettings.json
@@ -1,6 +1,6 @@
{
"ConnectionStrings": {
- "AihitConnection": "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;Encrypt=Optional;TrustServerCertificate=true;"
+ "AihitConnection": "Data Source=10.248.19.97; Initial Catalog=mao2;User ID=awhit-ipp-parr;pwd=ET3h$9y1LH#D;Encrypt=Optional;TrustServerCertificate=true;MultiSubnetFailover=True;"
},
"Logging": {
"LogLevel": {
diff --git a/PARR.AIHITRelationshipsSyncerWorker/Dockerfile b/PARR.AIHITRelationshipsSyncerWorker/Dockerfile
index 3c7eae02..3861e08f 100644
--- a/PARR.AIHITRelationshipsSyncerWorker/Dockerfile
+++ b/PARR.AIHITRelationshipsSyncerWorker/Dockerfile
@@ -31,7 +31,6 @@ RUN dotnet publish "./PARR.AIHITRelationshipsSyncerWorker.csproj" -c $BUILD_CONF
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
-
# 1. OpenSSL 3 EOF (UnsafeLegacyRenegotiation IgnoreUnexpectedEOF)
RUN sed -i 's/providers = provider_sect/providers = provider_sect\nssl_conf = ssl_sect/' /etc/ssl/openssl.cnf \
diff --git a/PARR.Test/PARR.Test.csproj b/PARR.Test/PARR.Test.csproj
index 4ea8c673..9d6a0fff 100644
--- a/PARR.Test/PARR.Test.csproj
+++ b/PARR.Test/PARR.Test.csproj
@@ -25,8 +25,4 @@
-
-
-
-
diff --git a/PARR.Test/Worker.cs b/PARR.Test/Worker.cs
index d0ce4b51..186d6d4a 100644
--- a/PARR.Test/Worker.cs
+++ b/PARR.Test/Worker.cs
@@ -1,7 +1,6 @@
using Microsoft.EntityFrameworkCore;
using PARR.Core.Common.Interfaces;
using PARR.Core.Repositories.Interfaces.Job;
-using PARR.Core.Services.UnitFilterService;
using PARR.Domain.Cache;
using PARR.Domain.Entities.Base.History;
using PARR.Domain.Enums;
@@ -9,7 +8,6 @@ using PARR.EsppApi;
using PARR.EsppApi.Constants;
using PARR.EsppApi.Models.Query;
using PARR.TemplateMatcher;
-using PARR.TemplateMatcher.Services.GroupedSync;
using PARR.TemplateMatcher.Services.Implementations;
using PARR.TemplateMatcher.Services.Interfaces;
using PARR.Test.NextRun;
@@ -47,7 +45,7 @@ namespace PARR.Test
//await TemplateMatcherTest();
- await PreCommitValidationTest();
+ await SimpleSyncTest();
@@ -167,19 +165,14 @@ namespace PARR.Test
#endregion
}
- #region PreCommitValidation
+ #region SimpleSyncTest
- private async Task PreCommitValidationTest()
+ private async Task SimpleSyncTest()
{
- _logger.LogInformation("=== НАЧАЛО PRE-COMMIT ВАЛИДАЦИИ ===");
-
await using var scope = serviceProvider.CreateAsyncScope();
- // === 1. Проверка Simple Pipeline ===
- _logger.LogInformation("--- Simple Pipeline ---");
- var simpleSync = scope.ServiceProvider
- .GetRequiredService>()
- .FirstOrDefault(s => s is SimpleTemplateSynchronizer);
+ var synchronizers = scope.ServiceProvider.GetRequiredService>();
+ var simpleSync = synchronizers.FirstOrDefault(s => s is SimpleTemplateSynchronizer);
if (simpleSync == null)
{
@@ -187,68 +180,52 @@ namespace PARR.Test
return;
}
- // Подставьте реальный JobId для Simple
- var simpleJobId = Guid.Parse("6ff1de05-80c3-4b38-846b-0c793fd7fc8c");
-
- try
+ var jobIds = new List
{
- var sw = Stopwatch.StartNew();
- await simpleSync.SyncTemplatesForJobAsync(simpleJobId, new HistoryInitiator
- {
- InitiatorIp = "127.0.0.1",
- InitiatorParrComponentId = ParrComponentsEnum.Master,
- InitiatorComment = "Pre-commit validation: Simple Pipeline"
- });
- sw.Stop();
- _logger.LogInformation("[OK] Simple Pipeline: завершено за {Ms} мс", sw.ElapsedMilliseconds);
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "[FAIL] Simple Pipeline: исключение");
- }
+ //Guid.Parse("cfb0d2dd-192a-4ed5-a29c-25f0abf61895"),//11010
+ //Guid.Parse("79976eaf-be7b-42a0-a4e3-a89d7f68a18e"),//17
+ Guid.Parse("6ff1de05-80c3-4b38-846b-0c793fd7fc8c")//318
+ };
- // === 2. Проверка Grouped Pipeline ===
- _logger.LogInformation("--- Grouped Pipeline ---");
- var groupedSync = scope.ServiceProvider
- .GetRequiredService>()
- .FirstOrDefault(s => s is GroupedTemplateSynchronizer);
-
- if (groupedSync == null)
+ if (!jobIds.Any())
{
- _logger.LogError("[FAIL] GroupedTemplateSynchronizer не найден в DI");
+ _logger.LogWarning("Список JobId пуст. Подставьте ID в код метода SimpleSyncTest.");
return;
}
- // Подставьте реальный JobGroupId для Grouped
- var groupedJobGroupId = Guid.Parse("51acaa95-08bf-425f-9a09-87b6a4cbc77e");
+ _logger.LogInformation("=== Тестовая синхронизация SimpleTemplateSynchronizer ({Count} Job) ===", jobIds.Count);
- try
+ int passed = 0;
+ int failed = 0;
+
+ foreach (var jobId in jobIds)
{
- var sw = Stopwatch.StartNew();
- await groupedSync.SyncTemplatesForJobGroupAsync(groupedJobGroupId, new HistoryInitiator
+ try
{
- InitiatorIp = "127.0.0.1",
- InitiatorParrComponentId = ParrComponentsEnum.Master,
- InitiatorComment = "Pre-commit validation: Grouped Pipeline"
- });
- sw.Stop();
- _logger.LogInformation("[OK] Grouped Pipeline: завершено за {Ms} мс", sw.ElapsedMilliseconds);
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "[FAIL] Grouped Pipeline: исключение");
+ var sw = Stopwatch.StartNew();
+
+ await simpleSync.SyncTemplatesForJobAsync(jobId, new HistoryInitiator
+ {
+ InitiatorIp = "127.0.0.1",
+ InitiatorParrComponentId = ParrComponentsEnum.Master,
+ InitiatorComment = "Тестовая синхронизация SimpleTemplateSynchronizer"
+ });
+
+ sw.Stop();
+ passed++;
+
+ _logger.LogInformation("[OK] Job {JobId}: синхронизация завершена за {ElapsedMs} мс",
+ jobId, sw.ElapsedMilliseconds);
+ }
+ catch (Exception ex)
+ {
+ failed++;
+ _logger.LogError(ex, "[FAIL] Job {JobId}: исключение при синхронизации", jobId);
+ }
}
- // === 3. Проверка контрактных констант ===
- _logger.LogInformation("--- Контрактные константы ---");
- var constantsType = typeof(PARR.TemplateMatcher.Constants.UnusedTemplateConstants);
- var fields = constantsType.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
-
- foreach (var field in fields)
- {
- var value = field.GetValue(null);
- _logger.LogInformation("[OK] Константа {Name} = '{Value}'", field.Name, value);
- }
+ _logger.LogInformation("=== Итого: {Passed} OK, {Failed} FAIL из {Total} ===",
+ passed, failed, jobIds.Count);
}
#endregion
diff --git a/PARR.Test/appsettings.Development.json b/PARR.Test/appsettings.Development.json
index b35b624f..6f470ecf 100644
--- a/PARR.Test/appsettings.Development.json
+++ b/PARR.Test/appsettings.Development.json
@@ -7,9 +7,13 @@
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Debug",
+ "PARR.TemplateMatcher": "Debug",
"PARR.DAL": "Information",
- "PARR.Infrastructure.Redis": "Information",
- "PARR.TemplateMatcher.Services.GroupedSync.GroupedTemplateProcessor": "Information"
+ "PARR.Core": "Debug",
+ "PARR.Infrastructure": "Debug",
+ "PARR.TemplateMatcher.Services.Implementations.SimpleTemplateSynchronizer": "Debug",
+ "PARR.TemplateMatcher.Services.Implementations.GroupedTemplateSynchronizer": "Debug"
}
},
"WriteTo": [