limit the parallel operations to 8 as this seems reasonable stable with sqlite
This commit is contained in:
parent
58942fd603
commit
809f892b07
@ -26,7 +26,7 @@ internal class FileIndexer : IFileIndexer
|
|||||||
{
|
{
|
||||||
var parallelOptions = new ParallelOptions
|
var parallelOptions = new ParallelOptions
|
||||||
{
|
{
|
||||||
MaxDegreeOfParallelism = Environment.ProcessorCount,
|
MaxDegreeOfParallelism = Math.Min(Environment.ProcessorCount, 8),
|
||||||
CancellationToken = ct
|
CancellationToken = ct
|
||||||
};
|
};
|
||||||
await Parallel.ForEachAsync(fileQueue.Reader.ReadAllAsync(ct), parallelOptions,
|
await Parallel.ForEachAsync(fileQueue.Reader.ReadAllAsync(ct), parallelOptions,
|
||||||
|
Loading…
Reference in New Issue
Block a user