Fix possible race condition

pull/2447/head
Bond_009 5 years ago
parent 6d6fa13550
commit d1e1aef5f7

@ -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

Loading…
Cancel
Save