diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-04-29 13:39:23 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-04-29 13:39:23 -0400 |
| commit | a75ce4197d89e90f97155fef81bbb65f954ae6a4 (patch) | |
| tree | 9f7cfc6ba232509f6b6a58890f8add598dca71ab /Emby.Drawing/ImageProcessor.cs | |
| parent | 88191e01dad8e47af23c7478cf49f2632fd9f52c (diff) | |
3.0.5597.1
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 9ad72d73f..59c2e95c7 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -53,11 +53,12 @@ namespace Emby.Drawing private readonly IImageEncoder _imageEncoder; private readonly SemaphoreSlim _imageProcessingSemaphore; - public ImageProcessor(ILogger logger, - IServerApplicationPaths appPaths, - IFileSystem fileSystem, - IJsonSerializer jsonSerializer, - IImageEncoder imageEncoder) + public ImageProcessor(ILogger logger, + IServerApplicationPaths appPaths, + IFileSystem fileSystem, + IJsonSerializer jsonSerializer, + IImageEncoder imageEncoder, + int maxConcurrentImageProcesses) { _logger = logger; _fileSystem = fileSystem; @@ -93,8 +94,8 @@ namespace Emby.Drawing } _cachedImagedSizes = new ConcurrentDictionary<Guid, ImageSize>(sizeDictionary); - var count = Environment.ProcessorCount; - _imageProcessingSemaphore = new SemaphoreSlim(count, count); + _logger.Info("ImageProcessor started with {0} max concurrent image processes", maxConcurrentImageProcesses); + _imageProcessingSemaphore = new SemaphoreSlim(maxConcurrentImageProcesses, maxConcurrentImageProcesses); } public string[] SupportedInputFormats |
