aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2023-03-15 18:30:03 +0100
committerGitHub <noreply@github.com>2023-03-15 18:30:03 +0100
commitcf1cb2eea582e2134fcbc530157bc562904cb9dc (patch)
treeacb691cf63bb2b541cbb4f6328dc26fbfebecbdc /Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
parent8d32ce168c4d62b9f6179fb5e4088efcea2a477b (diff)
parentd8ec3a5470fe602fab356c37720d38190aa713ef (diff)
Merge pull request #9418 from Bond-009/getawaiter
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
index e724618b3..d32759017 100644
--- a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
@@ -87,29 +87,30 @@ namespace Emby.Server.Implementations.EntryPoints
}
}
- private void UpdateTimerCallback(object? state)
+ private async void UpdateTimerCallback(object? state)
{
+ List<KeyValuePair<Guid, List<BaseItem>>> changes;
lock (_syncLock)
{
// Remove dupes in case some were saved multiple times
- var changes = _changedItems.ToList();
+ changes = _changedItems.ToList();
_changedItems.Clear();
- SendNotifications(changes, CancellationToken.None).GetAwaiter().GetResult();
-
if (_updateTimer is not null)
{
_updateTimer.Dispose();
_updateTimer = null;
}
}
+
+ await SendNotifications(changes, CancellationToken.None).ConfigureAwait(false);
}
private async Task SendNotifications(List<KeyValuePair<Guid, List<BaseItem>>> changes, CancellationToken cancellationToken)
{
- foreach (var pair in changes)
+ foreach ((var key, var value) in changes)
{
- await SendNotifications(pair.Key, pair.Value, cancellationToken).ConfigureAwait(false);
+ await SendNotifications(key, value, cancellationToken).ConfigureAwait(false);
}
}