🦭feat: 增加最大并发数常量
This commit is contained in:
parent
3a39a1da9b
commit
0d5bb9f82c
@ -21,6 +21,11 @@ public class CommonConst
|
|||||||
/// 日志分组名称
|
/// 日志分组名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string SysLogCategoryName = "System.Logging.LoggingMonitor";
|
public const string SysLogCategoryName = "System.Logging.LoggingMonitor";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 最大并发数
|
||||||
|
/// </summary>
|
||||||
|
public const int MaxConcurrent = 8;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 事件-增加异常日志
|
/// 事件-增加异常日志
|
||||||
|
|||||||
@ -391,7 +391,7 @@ public static class SqlSugarSetup
|
|||||||
else
|
else
|
||||||
entityTypes = entityTypes.Where(u => u.GetCustomAttribute<TenantAttribute>()?.configId.ToString() == config.ConfigId.ToString()).ToList(); // 自定义的库
|
entityTypes = entityTypes.Where(u => u.GetCustomAttribute<TenantAttribute>()?.configId.ToString() == config.ConfigId.ToString()).ToList(); // 自定义的库
|
||||||
|
|
||||||
var semaphore = new SemaphoreSlim(8); // 并发限制数量
|
var semaphore = new SemaphoreSlim(CommonConst.MaxConcurrent); // 并发限制数量
|
||||||
int taskIndex = 0, size = entityTypes.Count;
|
int taskIndex = 0, size = entityTypes.Count;
|
||||||
var taskList = entityTypes.Select(entityType => Task.Run(() =>
|
var taskList = entityTypes.Select(entityType => Task.Run(() =>
|
||||||
{
|
{
|
||||||
@ -525,7 +525,8 @@ public static class SqlSugarSetup
|
|||||||
.WhereIF(config.SeedSettings.EnableIncreSeed, u => u.IsDefined(typeof(IncreSeedAttribute), false))
|
.WhereIF(config.SeedSettings.EnableIncreSeed, u => u.IsDefined(typeof(IncreSeedAttribute), false))
|
||||||
.OrderBy(u => u.GetCustomAttributes(typeof(SeedDataAttribute), false).Length > 0 ? ((SeedDataAttribute)u.GetCustomAttributes(typeof(SeedDataAttribute), false)[0]).Order : 0).ToList();
|
.OrderBy(u => u.GetCustomAttributes(typeof(SeedDataAttribute), false).Length > 0 ? ((SeedDataAttribute)u.GetCustomAttributes(typeof(SeedDataAttribute), false)[0]).Order : 0).ToList();
|
||||||
|
|
||||||
var semaphore = new SemaphoreSlim(8); // 并发限制数量
|
|
||||||
|
var semaphore = new SemaphoreSlim(CommonConst.MaxConcurrent); // 并发限制数量
|
||||||
int taskIndex = 0, size = seedDataTypes.Count;
|
int taskIndex = 0, size = seedDataTypes.Count;
|
||||||
var taskList = seedDataTypes.Select(seedType => Task.Run(() =>
|
var taskList = seedDataTypes.Select(seedType => Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user