mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 06:17:14 -04:00
Fix possible race condition
This commit is contained in:
parent
6d6fa13550
commit
d1e1aef5f7
@ -970,9 +970,8 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
var id = item.Id;
|
var id = item.Id;
|
||||||
_logger.LogInformation("OnRefreshProgress {0} {1}", id.ToString("N", CultureInfo.InvariantCulture), progress);
|
_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)));
|
RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user