Skip to content

Commit ed603cb

Browse files
authored
fix: check min must greater 1 (#393)
1 parent 161ad73 commit ed603cb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc.Elasticsearch/Extenistions/IElasticClientExtenstion.cs

+2
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ private static void CreateFieldKeyword(string name, ElasticseacherMappingRespons
466466
internal static void ScrollQuery(this IElasticClient client, ElasticsearchScrollRequestDto query, Action<IEnumerable<TraceResponseDto>> action)
467467
{
468468
int numberOfSlices = Environment.ProcessorCount;
469+
if (numberOfSlices <= 1)
470+
numberOfSlices = 2;
469471
var scrollAllObservable = client.ScrollAll<object>(query.Scroll, numberOfSlices, sc => sc
470472
.MaxDegreeOfParallelism(numberOfSlices)
471473
.Search(s => s.Index(ElasticConstant.Trace.IndexName).AddCondition(query, false))

0 commit comments

Comments
 (0)