修复测试服务context错误

This commit is contained in:
lindj 2024-01-19 16:07:52 +08:00
parent f167256082
commit b0795f9a2c
4 changed files with 95 additions and 89 deletions

View File

@ -69,6 +69,7 @@ public class MainHostedService : BackgroundService
var bigTablesDic = new Dictionary<string, TableInfo>
{
{"order",new TableInfo{SimulaRowCount=5019216 }},
{"order_block_plan",new TableInfo{SimulaRowCount=2725553 }},//CreateTime < 202301的删除
{"order_block_plan_result",new TableInfo{SimulaRowCount=1174096 }},
{"order_box_block",new TableInfo{SimulaRowCount=29755672 }},
@ -81,7 +82,6 @@ public class MainHostedService : BackgroundService
var smallTablesDic = new Dictionary<string, TableInfo>
{
{"machine",new TableInfo{SimulaRowCount=14655 }},
{"order",new TableInfo{SimulaRowCount=5019216 }},
{"order_data_block",new TableInfo{SimulaRowCount=731800334 }},
{"order_data_goods",new TableInfo{SimulaRowCount=25803671 }},
{"order_data_parts",new TableInfo{SimulaRowCount=468517543 }},

View File

@ -14,7 +14,6 @@ using Serilog;
using Microsoft.Extensions.Caching.Distributed;
using Serilog.Events;
await RunProgram();
return;
@ -463,7 +462,8 @@ async Task RunProgram()
AllowUserVariables = true,
IgnoreCommandTransaction = true,
TreatTinyAsBoolean = false,
MaximumPoolSize = 50
MaximumPoolSize = 50,
SslMode = MySqlSslMode.None,
}.ConnectionString;
});

View File

@ -39,6 +39,8 @@ namespace ConsoleApp2.SimulationService
}
foreach (var tableName in tasksOptions.TableInfoConfig.Keys)
{
_logger.LogInformation("Working table: {tableName}", tableName);
var dataCount = tasksOptions.TableInfoConfig[tableName].SimulaRowCount;//当前表要生成的总数据量
var companyTotallCount = 1000;//当前表每个公司生成的总数据量
var tempRecords = new List<DataRecord>();
@ -111,6 +113,10 @@ namespace ConsoleApp2.SimulationService
foreach (var rc in tempRecords)
{
_context.AddInput();
if(_context.InputCount== 2000000)
{
var a = 1;
}
producerQueue.Enqueue(rc);
if (cancellationToken.IsCancellationRequested)
return;
@ -125,7 +131,7 @@ namespace ConsoleApp2.SimulationService
//_logger.LogInformation("File '{File}' input completed", Path.GetFileName(sqlPath));
}
_context.CompleteInput();
context.CompleteInput();
_logger.LogInformation("***** Csv input service completed *****");
}
}