Fix possible race condition

This commit is contained in:
Bond_009 2020-02-26 18:19:34 +01:00
parent 6d6fa13550
commit d1e1aef5f7

View File

@ -970,9 +970,8 @@ namespace MediaBrowser.Providers.Manager
var id = item.Id;
_logger.LogInformation("OnRefreshProgress {0} {1}", id.ToString("N", CultureInfo.InvariantCulture), progress);
if (_activeRefreshes.ContainsKey(id))
if (_activeRefreshes.TryAdd(id, progress))
{
_activeRefreshes[id] = progress;
RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
}
else