only recreate the lazy when needed

pull/4242/head
Gary Wilber 4 years ago
parent 26a05e6974
commit 74f211960a

@ -107,9 +107,12 @@ namespace MediaBrowser.Controller.BaseItemManager
/// Creates the metadata refresh throttler. /// Creates the metadata refresh throttler.
/// </summary> /// </summary>
private void SetupMetadataThrottler() private void SetupMetadataThrottler()
{
if (MetadataRefreshThrottler == null || MetadataRefreshThrottler.IsValueCreated)
{ {
MetadataRefreshThrottler = new Lazy<SemaphoreSlim>(() => new SemaphoreSlim(_metadataRefreshConcurrency)); MetadataRefreshThrottler = new Lazy<SemaphoreSlim>(() => new SemaphoreSlim(_metadataRefreshConcurrency));
} }
}
/// <summary> /// <summary>
/// Returns the metadata refresh concurrency. /// Returns the metadata refresh concurrency.

Loading…
Cancel
Save