only recreate the lazy when needed

This commit is contained in:
Gary Wilber 2020-12-02 23:14:18 -08:00
parent 26a05e6974
commit 74f211960a

View File

@ -108,7 +108,10 @@ namespace MediaBrowser.Controller.BaseItemManager
/// </summary>
private void SetupMetadataThrottler()
{
MetadataRefreshThrottler = new Lazy<SemaphoreSlim>(() => new SemaphoreSlim(_metadataRefreshConcurrency));
if (MetadataRefreshThrottler == null || MetadataRefreshThrottler.IsValueCreated)
{
MetadataRefreshThrottler = new Lazy<SemaphoreSlim>(() => new SemaphoreSlim(_metadataRefreshConcurrency));
}
}
/// <summary>