mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
Reduce bottlenecks scan code (#9863)
This commit is contained in:
parent
d14b1a1600
commit
3982b0e057
13 changed files with 64 additions and 219 deletions
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
private readonly IServerConfigurationManager _serverConfig;
|
||||
private readonly string _startupOptionFFmpegPath;
|
||||
|
||||
private readonly SemaphoreSlim _thumbnailResourcePool = new SemaphoreSlim(2, 2);
|
||||
private readonly SemaphoreSlim _thumbnailResourcePool;
|
||||
|
||||
private readonly object _runningProcessesLock = new object();
|
||||
private readonly List<ProcessWrapper> _runningProcesses = new List<ProcessWrapper>();
|
||||
|
|
@ -113,6 +113,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
_jsonSerializerOptions = new JsonSerializerOptions(JsonDefaults.Options);
|
||||
_jsonSerializerOptions.Converters.Add(new JsonBoolStringConverter());
|
||||
|
||||
var semaphoreCount = 2 * Environment.ProcessorCount;
|
||||
_thumbnailResourcePool = new SemaphoreSlim(semaphoreCount, semaphoreCount);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue