diff --git a/src/automatica.core/Automatica.Core.Base/Automatica.Core.Base.csproj b/src/automatica.core/Automatica.Core.Base/Automatica.Core.Base.csproj index c344e0f4..512e7229 100644 --- a/src/automatica.core/Automatica.Core.Base/Automatica.Core.Base.csproj +++ b/src/automatica.core/Automatica.Core.Base/Automatica.Core.Base.csproj @@ -16,7 +16,7 @@ https://github.com/automatica-core - + @@ -35,4 +35,4 @@ - \ No newline at end of file + diff --git a/src/automatica.core/Automatica.Core.Internals/Automatica.Core.Internals.csproj b/src/automatica.core/Automatica.Core.Internals/Automatica.Core.Internals.csproj index 7298f0d9..de5c664e 100644 --- a/src/automatica.core/Automatica.Core.Internals/Automatica.Core.Internals.csproj +++ b/src/automatica.core/Automatica.Core.Internals/Automatica.Core.Internals.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/automatica.core/Automatica.Push/Hubs/UpdateHub.cs b/src/automatica.core/Automatica.Push/Hubs/UpdateHub.cs index bcfab5c6..6887c53f 100644 --- a/src/automatica.core/Automatica.Push/Hubs/UpdateHub.cs +++ b/src/automatica.core/Automatica.Push/Hubs/UpdateHub.cs @@ -36,11 +36,11 @@ public Task StartUpdateDownload(ServerVersion version) { Task.Run(async () => { - using var releaser = await _asyncKeyedLocker.LockAsync(nameof(UpdateHub), 10).ConfigureAwait(false); - if (!releaser.EnteredSemaphore) + using var releaser = await _asyncKeyedLocker.LockOrNullAsync(nameof(UpdateHub), 10).ConfigureAwait(false); + if (releaser is null) { return; - } + } var previousState = 0; _api.DownloadUpdateProgressChanged += (sender, e) => @@ -72,8 +72,8 @@ private Task DownloadPlugin(Plugin plugin, bool install) { Task.Run(async () => { - using var releaser = await _asyncKeyedLocker.LockAsync(nameof(UpdateHub), 10).ConfigureAwait(false); - if (!releaser.EnteredSemaphore) + using var releaser = await _asyncKeyedLocker.LockOrNullAsync(nameof(UpdateHub), 10).ConfigureAwait(false); + if (releaser is null) { return; }