mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 22:43:07 +03:00
fix parallelism when set to 0
This commit is contained in:
@@ -564,6 +564,9 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
progress.Report(childrenProgress.Average());
|
progress.Report(childrenProgress.Average());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var fanoutConcurrency = ConfigurationManager.Configuration.LibraryScanFanoutConcurrency;
|
||||||
|
var parallelism = fanoutConcurrency == 0 ? Environment.ProcessorCount : fanoutConcurrency;
|
||||||
|
|
||||||
var actionBlock = new ActionBlock<int>(
|
var actionBlock = new ActionBlock<int>(
|
||||||
async i =>
|
async i =>
|
||||||
{
|
{
|
||||||
@@ -588,7 +591,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
},
|
},
|
||||||
new ExecutionDataflowBlockOptions
|
new ExecutionDataflowBlockOptions
|
||||||
{
|
{
|
||||||
MaxDegreeOfParallelism = ConfigurationManager.Configuration.LibraryScanFanoutConcurrency,
|
MaxDegreeOfParallelism = parallelism,
|
||||||
CancellationToken = cancellationToken,
|
CancellationToken = cancellationToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user