添加启动参数校验,发布x.3.0.2版本

This commit is contained in:
xuejiaming 2021-10-04 10:30:24 +08:00
parent ab31ffd83b
commit 65aef115cb
2 changed files with 9 additions and 3 deletions

View File

@ -1,8 +1,8 @@
:start
::定义版本
set EFCORE2=2.3.0.01
set EFCORE3=3.3.0.01
set EFCORE5=5.3.0.01
set EFCORE2=2.3.0.02
set EFCORE3=3.3.0.02
set EFCORE5=5.3.0.02
::删除所有bin与obj下的文件
@echo off

View File

@ -35,6 +35,12 @@ namespace ShardingCore.DIExtensions
{
var shardingCoreBeginOptions = new ShardingCoreBeginOptions();
shardingCoreBeginOptionsConfigure?.Invoke(shardingCoreBeginOptions);
if (shardingCoreBeginOptions.ParallelQueryMaxThreadCount <= 0)
throw new ArgumentException(
$"{nameof(shardingCoreBeginOptions.ParallelQueryMaxThreadCount)} should greater than zero thread count");
if (shardingCoreBeginOptions.ParallelQueryTimeOut.TotalMilliseconds <= 0)
throw new ArgumentException(
$"{nameof(shardingCoreBeginOptions.ParallelQueryTimeOut)} should greater than zero milliseconds");
ShardingConfigOption.EnsureCreatedWithOutShardingTable = shardingCoreBeginOptions.EnsureCreatedWithOutShardingTable;
ShardingConfigOption.AutoTrackEntity = shardingCoreBeginOptions.AutoTrackEntity;
ShardingConfigOption.ParallelQueryMaxThreadCount = shardingCoreBeginOptions.ParallelQueryMaxThreadCount;