fix(aihitLoader): Добавлены параметры понижения версии TLS
This commit is contained in:
@@ -25,8 +25,4 @@
|
||||
<ProjectReference Include="..\PARR.TemplateDistributor\PARR.TemplateDistributor.csproj" />
|
||||
<ProjectReference Include="..\PARR.TemplateMatcher\PARR.TemplateMatcher.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="log\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -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<IEnumerable<ITemplateSynchronizer>>()
|
||||
.FirstOrDefault(s => s is SimpleTemplateSynchronizer);
|
||||
var synchronizers = scope.ServiceProvider.GetRequiredService<IEnumerable<ITemplateSynchronizer>>();
|
||||
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<Guid>
|
||||
{
|
||||
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<IEnumerable<ITemplateSynchronizer>>()
|
||||
.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
|
||||
|
||||
@@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user