track bug 跨库也支持track

This commit is contained in:
xuejiaming 2023-07-07 21:56:59 +08:00
parent 341ecc550f
commit 80a8041059
3 changed files with 11 additions and 9 deletions

View File

@ -62,8 +62,7 @@ namespace ShardingCore.Sharding.ShardingExecutors
{
if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext)
{
var mergeResult = _shardingQueryExecutor.Execute<TResult>(mergeQueryCompilerContext);
return ResultTrackExecute(mergeResult, queryCompilerContext, TrackEnumerable, Track);
return _shardingQueryExecutor.Execute<TResult>(mergeQueryCompilerContext);
}
throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint());
}
@ -120,8 +119,7 @@ namespace ShardingCore.Sharding.ShardingExecutors
{
if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext)
{
var mergeResult = _shardingQueryExecutor.ExecuteAsync<TResult>(mergeQueryCompilerContext);
return ResultTrackExecute(mergeResult, queryCompilerContext, TrackAsyncEnumerable, TrackAsync);
return _shardingQueryExecutor.ExecuteAsync<TResult>(mergeQueryCompilerContext);
}
throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint());
}
@ -143,8 +141,7 @@ namespace ShardingCore.Sharding.ShardingExecutors
{
if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext)
{
var mergeResult= _shardingQueryExecutor.ExecuteAsync<IAsyncEnumerable<TResult>>(mergeQueryCompilerContext);
return ResultTrackExecute(mergeResult, queryCompilerContext, TrackEnumerable, Track);
return _shardingQueryExecutor.ExecuteAsync<IAsyncEnumerable<TResult>>(mergeQueryCompilerContext);
}
throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint());
}
@ -162,8 +159,7 @@ namespace ShardingCore.Sharding.ShardingExecutors
{
if (queryCompilerContext is IMergeQueryCompilerContext mergeQueryCompilerContext)
{
var mergeResult= _shardingQueryExecutor.ExecuteAsync<Task<TResult>>(mergeQueryCompilerContext);
return ResultTrackExecute(mergeResult, queryCompilerContext, TrackEnumerable, TrackAsync);
return _shardingQueryExecutor.ExecuteAsync<Task<TResult>>(mergeQueryCompilerContext);
}
throw new ShardingCoreNotFoundException(queryCompilerContext.GetQueryExpression().ShardingPrint());
}

View File

@ -278,7 +278,13 @@ namespace ShardingCore.Sharding
public bool IsUseShardingTrack(Type entityType)
{
if (!IsParallelQuery())
{
if (IsCrossDataSource)
{
return true;
}
return false;
}
return QueryTrack() && _trackerManager.EntityUseTrack(entityType);
}