diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-03-01 18:57:23 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-03-14 12:05:49 +0100 |
| commit | d8ec3a5470fe602fab356c37720d38190aa713ef (patch) | |
| tree | cd45b3a6ccd0085666d84f8b71ca7606fb94f68a /Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs | |
| parent | af611367c14e2d56e6346b03bda7d75ab6f04b96 (diff) | |
Reduce usage of GetAwaiter().GetResult()
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs')
| -rw-r--r-- | Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs | 13 |
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); } } |
