From fbcbf3347baf97cbd49beb7908444258f9a1777a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 20 Mar 2025 08:55:40 +0100 Subject: [PATCH 1/3] Remove analyser for configure await --- src/.editorconfig | 3 +- src/HealthCheckApp/Program.cs | 2 +- src/ServiceControl.Config/.editorconfig | 3 -- .../DomainEvents.cs | 4 +-- .../MetricsReporter.cs | 2 +- .../AsyncTimer.cs | 10 +++--- .../IntegratedSetup.cs | 2 +- .../WaitHandleExtensions.cs | 4 +-- src/ServiceControl.Infrastructure/Watchdog.cs | 10 +++--- src/ServiceControl.Monitoring/.editorconfig | 4 --- .../ServiceControl.Monitoring.csproj | 4 +++ .../RavenExternalPersistenceLifecycle.cs | 2 +- .../RunEngineTasksExplicitly.cs | 10 +++--- .../Instances/MonitoringInstance.cs | 2 +- .../Instances/MonitoringNewInstance.cs | 2 +- .../Instances/ServiceControlBaseService.cs | 2 +- .../ServiceControlInstallableBase.cs | 2 +- .../Instances/ServiceControlInstance.cs | 2 +- .../Unattended/UnattendAuditInstaller.cs | 2 +- .../Unattended/UnattendMonitoringInstaller.cs | 4 +-- .../UnattendServiceControlInstaller.cs | 4 +-- .../Validation/AbstractCommandChecks.cs | 34 +++++++++---------- .../Validation/PathsValidator.cs | 4 +-- 23 files changed, 57 insertions(+), 61 deletions(-) delete mode 100644 src/ServiceControl.Monitoring/.editorconfig diff --git a/src/.editorconfig b/src/.editorconfig index 6a0594940d..823cff8b4c 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -27,10 +27,9 @@ insert_final_newline = false dotnet_diagnostic.CA1068.severity = error dotnet_diagnostic.CA1710.severity = error dotnet_diagnostic.CA1711.severity = error -dotnet_diagnostic.CA2007.severity = error +dotnet_diagnostic.CA2007.severity = none dotnet_diagnostic.CA2016.severity = error - #### .NET Coding Conventions #### # this. and Me. preferences diff --git a/src/HealthCheckApp/Program.cs b/src/HealthCheckApp/Program.cs index d274271715..cf5c1a7656 100644 --- a/src/HealthCheckApp/Program.cs +++ b/src/HealthCheckApp/Program.cs @@ -7,7 +7,7 @@ throw new Exception("Missing URL"); } -var response = await http.GetAsync(url).ConfigureAwait(false); +var response = await http.GetAsync(url); response.EnsureSuccessStatusCode(); if (response.Content.Headers.ContentType?.MediaType != "application/json" || response.Content.Headers.ContentLength == 0) diff --git a/src/ServiceControl.Config/.editorconfig b/src/ServiceControl.Config/.editorconfig index e1ed6f2495..556472372b 100644 --- a/src/ServiceControl.Config/.editorconfig +++ b/src/ServiceControl.Config/.editorconfig @@ -1,8 +1,5 @@ [*.cs] -# Justification: Application synchronization contexts don't require ConfigureAwait(false) -dotnet_diagnostic.CA2007.severity = none - # may be enabled in future dotnet_diagnostic.PS0003.severity = none # A parameter of type CancellationToken on a non-private delegate or method should be optional dotnet_diagnostic.PS0013.severity = none # A Func used as a method parameter with a Task, ValueTask, or ValueTask return type argument should have at least one CancellationToken parameter type argument unless it has a parameter type argument implementing ICancellableContext diff --git a/src/ServiceControl.DomainEvents/DomainEvents.cs b/src/ServiceControl.DomainEvents/DomainEvents.cs index 5443c784d7..e3b85fb206 100644 --- a/src/ServiceControl.DomainEvents/DomainEvents.cs +++ b/src/ServiceControl.DomainEvents/DomainEvents.cs @@ -21,7 +21,7 @@ public async Task Raise(T domainEvent, CancellationToken cancellationToken) w try { await handler.Handle(domainEvent, cancellationToken) - .ConfigureAwait(false); + ; } catch (Exception e) { @@ -36,7 +36,7 @@ await handler.Handle(domainEvent, cancellationToken) try { await handler.Handle(domainEvent, cancellationToken) - .ConfigureAwait(false); + ; } catch (Exception e) { diff --git a/src/ServiceControl.Infrastructure.Metrics/MetricsReporter.cs b/src/ServiceControl.Infrastructure.Metrics/MetricsReporter.cs index 73dd600550..93485c9fa1 100644 --- a/src/ServiceControl.Infrastructure.Metrics/MetricsReporter.cs +++ b/src/ServiceControl.Infrastructure.Metrics/MetricsReporter.cs @@ -29,7 +29,7 @@ public void Start() while (!tokenSource.IsCancellationRequested) { Print(); - await Task.Delay(interval, tokenSource.Token).ConfigureAwait(false); + await Task.Delay(interval, tokenSource.Token); } } catch (OperationCanceledException) when (tokenSource.IsCancellationRequested) diff --git a/src/ServiceControl.Infrastructure/AsyncTimer.cs b/src/ServiceControl.Infrastructure/AsyncTimer.cs index 34aa3b62b9..efd2e8ecba 100644 --- a/src/ServiceControl.Infrastructure/AsyncTimer.cs +++ b/src/ServiceControl.Infrastructure/AsyncTimer.cs @@ -22,20 +22,20 @@ public TimerJob(Func> callback, { try { - await Task.Delay(due, token).ConfigureAwait(false); + await Task.Delay(due, token); while (!token.IsCancellationRequested) { try { - var result = await callback(token).ConfigureAwait(false); + var result = await callback(token); if (result == TimerJobExecutionResult.DoNotContinueExecuting) { tokenSource.Cancel(); } else if (result == TimerJobExecutionResult.ScheduleNextExecution) { - await Task.Delay(interval, token).ConfigureAwait(false); + await Task.Delay(interval, token); } //Otherwise execute immediately @@ -64,14 +64,14 @@ public async Task Stop() return; } - await tokenSource.CancelAsync().ConfigureAwait(false); + await tokenSource.CancelAsync(); tokenSource.Dispose(); if (task != null) { try { - await task.ConfigureAwait(false); + await task; } catch (OperationCanceledException) when (tokenSource.IsCancellationRequested) { diff --git a/src/ServiceControl.Infrastructure/IntegratedSetup.cs b/src/ServiceControl.Infrastructure/IntegratedSetup.cs index a72a565e7c..5c096316a6 100644 --- a/src/ServiceControl.Infrastructure/IntegratedSetup.cs +++ b/src/ServiceControl.Infrastructure/IntegratedSetup.cs @@ -52,7 +52,7 @@ public static async Task Run() process.BeginOutputReadLine(); process.BeginErrorReadLine(); - await process.WaitForExitAsync().ConfigureAwait(false); + await process.WaitForExitAsync(); return process.ExitCode; } diff --git a/src/ServiceControl.Infrastructure/WaitHandleExtensions.cs b/src/ServiceControl.Infrastructure/WaitHandleExtensions.cs index 051ca91197..445b7b4170 100644 --- a/src/ServiceControl.Infrastructure/WaitHandleExtensions.cs +++ b/src/ServiceControl.Infrastructure/WaitHandleExtensions.cs @@ -22,12 +22,12 @@ public static async Task WaitOneAsync(this WaitHandle handle, int millisec tokenRegistration = cancellationToken.Register( state => ((TaskCompletionSource)state).TrySetCanceled(), tcs); - return await tcs.Task.ConfigureAwait(false); + return await tcs.Task; } finally { registeredHandle?.Unregister(null); - await tokenRegistration.DisposeAsync().ConfigureAwait(false); + await tokenRegistration.DisposeAsync(); } } diff --git a/src/ServiceControl.Infrastructure/Watchdog.cs b/src/ServiceControl.Infrastructure/Watchdog.cs index 56d111cf78..3285a17803 100644 --- a/src/ServiceControl.Infrastructure/Watchdog.cs +++ b/src/ServiceControl.Infrastructure/Watchdog.cs @@ -61,7 +61,7 @@ public Task Start(Action onFailedOnStartup, CancellationToken cancellationToken) cancellationTokenSource.CancelAfter(MaxStartDurationMs); log.Debug($"Ensuring {taskName} is running"); - await ensureStarted(cancellationTokenSource.Token).ConfigureAwait(false); + await ensureStarted(cancellationTokenSource.Token); clearFailure(); startup = false; } @@ -85,7 +85,7 @@ public Task Start(Action onFailedOnStartup, CancellationToken cancellationToken) } try { - await Task.Delay(timeToWaitBetweenStartupAttempts, shutdownTokenSource.Token).ConfigureAwait(false); + await Task.Delay(timeToWaitBetweenStartupAttempts, shutdownTokenSource.Token); } catch (OperationCanceledException) when (shutdownTokenSource.IsCancellationRequested) { @@ -102,8 +102,8 @@ public async Task Stop(CancellationToken cancellationToken) try { log.Debug($"Stopping watching process {taskName}"); - await shutdownTokenSource.CancelAsync().ConfigureAwait(false); - await watchdog.ConfigureAwait(false); + await shutdownTokenSource.CancelAsync(); + await watchdog; } catch (Exception e) { @@ -112,7 +112,7 @@ public async Task Stop(CancellationToken cancellationToken) } finally { - await ensureStopped(cancellationToken).ConfigureAwait(false); + await ensureStopped(cancellationToken); } } } diff --git a/src/ServiceControl.Monitoring/.editorconfig b/src/ServiceControl.Monitoring/.editorconfig deleted file mode 100644 index aff82c0034..0000000000 --- a/src/ServiceControl.Monitoring/.editorconfig +++ /dev/null @@ -1,4 +0,0 @@ -[*.cs] - -# Justification: Application synchronization contexts don't require ConfigureAwait(false) -dotnet_diagnostic.CA2007.severity = none diff --git a/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj b/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj index 35246ea1b8..59507d6bac 100644 --- a/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj +++ b/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj @@ -42,4 +42,8 @@ + + + + \ No newline at end of file diff --git a/src/ServiceControl.Persistence.RavenDB/RavenExternalPersistenceLifecycle.cs b/src/ServiceControl.Persistence.RavenDB/RavenExternalPersistenceLifecycle.cs index a6c8d265f9..bee63cdac9 100644 --- a/src/ServiceControl.Persistence.RavenDB/RavenExternalPersistenceLifecycle.cs +++ b/src/ServiceControl.Persistence.RavenDB/RavenExternalPersistenceLifecycle.cs @@ -51,7 +51,7 @@ public async Task Initialize(CancellationToken cancellationToken) await StartupChecks.EnsureServerVersion(store, cancellationToken); var databaseSetup = new DatabaseSetup(settings, store); - await databaseSetup.Execute(cancellationToken).ConfigureAwait(false); + await databaseSetup.Execute(cancellationToken); } finally { diff --git a/src/ServiceControlInstaller.Engine.UnitTests/RunEngineTasksExplicitly.cs b/src/ServiceControlInstaller.Engine.UnitTests/RunEngineTasksExplicitly.cs index 97927c0bcf..2dc2465545 100644 --- a/src/ServiceControlInstaller.Engine.UnitTests/RunEngineTasksExplicitly.cs +++ b/src/ServiceControlInstaller.Engine.UnitTests/RunEngineTasksExplicitly.cs @@ -72,7 +72,7 @@ public async Task CreateInstanceMSMQ() // constructer of ServiceControlInstanceMetadata extracts version from zip details.Version = Constants.CurrentVersion; - await details.Validate(s => Task.FromResult(false)).ConfigureAwait(false); + await details.Validate(s => Task.FromResult(false)); if (details.ReportCard.HasErrors) { throw new Exception($"Validation errors: {string.Join("\r\n", details.ReportCard.Errors)}"); @@ -95,27 +95,27 @@ public async Task ChangeConfigTests() RemoveAltMSMQQueues(); logger.Info("Recreating the MSMQ instance"); - await CreateInstanceMSMQ().ConfigureAwait(false); + await CreateInstanceMSMQ(); logger.Info("Changing the URLACL"); var msmqTestInstance = InstanceFinder.ServiceControlInstances().First(p => p.Name.Equals("Test.ServiceControl.MSMQ", StringComparison.OrdinalIgnoreCase)); msmqTestInstance.HostName = Environment.MachineName; msmqTestInstance.Port = 33338; msmqTestInstance.DatabaseMaintenancePort = 33339; - await installer.Update(msmqTestInstance, true).ConfigureAwait(false); + await installer.Update(msmqTestInstance, true); Assert.That(msmqTestInstance.Service.Status, Is.EqualTo(ServiceControllerStatus.Running), "Update URL change failed"); logger.Info("Changing LogPath"); msmqTestInstance = InstanceFinder.ServiceControlInstances().First(p => p.Name.Equals("Test.ServiceControl.MSMQ", StringComparison.OrdinalIgnoreCase)); msmqTestInstance.LogPath = Path.Combine(Path.GetTempPath(), "testloggingchange"); - await installer.Update(msmqTestInstance, true).ConfigureAwait(false); + await installer.Update(msmqTestInstance, true); Assert.That(msmqTestInstance.Service.Status, Is.EqualTo(ServiceControllerStatus.Running), "Update Logging changed failed"); logger.Info("Updating Queue paths"); msmqTestInstance = InstanceFinder.ServiceControlInstances().First(p => p.Name.Equals("Test.ServiceControl.MSMQ", StringComparison.OrdinalIgnoreCase)); msmqTestInstance.AuditQueue = "alternateAudit"; msmqTestInstance.ErrorQueue = "alternateError"; - await installer.Update(msmqTestInstance, true).ConfigureAwait(false); + await installer.Update(msmqTestInstance, true); Assert.That(msmqTestInstance.Service.Status, Is.EqualTo(ServiceControllerStatus.Running), "Update Queues changed failed"); } diff --git a/src/ServiceControlInstaller.Engine/Instances/MonitoringInstance.cs b/src/ServiceControlInstaller.Engine/Instances/MonitoringInstance.cs index 7a1be79145..dcaabe7636 100644 --- a/src/ServiceControlInstaller.Engine/Instances/MonitoringInstance.cs +++ b/src/ServiceControlInstaller.Engine/Instances/MonitoringInstance.cs @@ -116,7 +116,7 @@ public async Task ValidateChanges() { try { - await new PathsValidator(this).RunValidation(false).ConfigureAwait(false); + await new PathsValidator(this).RunValidation(false); } catch (EngineValidationException ex) { diff --git a/src/ServiceControlInstaller.Engine/Instances/MonitoringNewInstance.cs b/src/ServiceControlInstaller.Engine/Instances/MonitoringNewInstance.cs index 6af1986df6..b4d8463673 100644 --- a/src/ServiceControlInstaller.Engine/Instances/MonitoringNewInstance.cs +++ b/src/ServiceControlInstaller.Engine/Instances/MonitoringNewInstance.cs @@ -181,7 +181,7 @@ public async Task Validate(Func> promptToProceed) try { - ReportCard.CancelRequested = await new PathsValidator(this).RunValidation(true, promptToProceed).ConfigureAwait(false); + ReportCard.CancelRequested = await new PathsValidator(this).RunValidation(true, promptToProceed); } catch (EngineValidationException ex) { diff --git a/src/ServiceControlInstaller.Engine/Instances/ServiceControlBaseService.cs b/src/ServiceControlInstaller.Engine/Instances/ServiceControlBaseService.cs index b15aa10c8f..6ea39e10b8 100644 --- a/src/ServiceControlInstaller.Engine/Instances/ServiceControlBaseService.cs +++ b/src/ServiceControlInstaller.Engine/Instances/ServiceControlBaseService.cs @@ -398,7 +398,7 @@ public void SetupInstance() public async Task ValidateChanges() { - await ValidatePaths().ConfigureAwait(false); + await ValidatePaths(); ValidateQueueNames(); diff --git a/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstallableBase.cs b/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstallableBase.cs index be5ebb7775..ef86c82610 100644 --- a/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstallableBase.cs +++ b/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstallableBase.cs @@ -245,7 +245,7 @@ public async Task Validate(Func> promptToProceed) try { - ReportCard.CancelRequested = await ValidatePaths(promptToProceed).ConfigureAwait(false); + ReportCard.CancelRequested = await ValidatePaths(promptToProceed); } catch (EngineValidationException ex) { diff --git a/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstance.cs b/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstance.cs index f500a82545..a111ecbd96 100644 --- a/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstance.cs +++ b/src/ServiceControlInstaller.Engine/Instances/ServiceControlInstance.cs @@ -77,7 +77,7 @@ protected override async Task ValidatePaths() { try { - await new PathsValidator(this).RunValidation(false).ConfigureAwait(false); + await new PathsValidator(this).RunValidation(false); } catch (EngineValidationException ex) { diff --git a/src/ServiceControlInstaller.Engine/Unattended/UnattendAuditInstaller.cs b/src/ServiceControlInstaller.Engine/Unattended/UnattendAuditInstaller.cs index b10b2002f6..5949599f38 100644 --- a/src/ServiceControlInstaller.Engine/Unattended/UnattendAuditInstaller.cs +++ b/src/ServiceControlInstaller.Engine/Unattended/UnattendAuditInstaller.cs @@ -27,7 +27,7 @@ public async Task Add(ServiceControlAuditNewInstance details, Func Add(MonitoringNewInstance details, Func Update(MonitoringInstance instance, bool startService) { instance.ReportCard = new ReportCard(); - await instance.ValidateChanges().ConfigureAwait(false); + await instance.ValidateChanges(); if (instance.ReportCard.HasErrors) { foreach (var error in instance.ReportCard.Errors) diff --git a/src/ServiceControlInstaller.Engine/Unattended/UnattendServiceControlInstaller.cs b/src/ServiceControlInstaller.Engine/Unattended/UnattendServiceControlInstaller.cs index 2dfcb9570d..f8ccbbbd7e 100644 --- a/src/ServiceControlInstaller.Engine/Unattended/UnattendServiceControlInstaller.cs +++ b/src/ServiceControlInstaller.Engine/Unattended/UnattendServiceControlInstaller.cs @@ -32,7 +32,7 @@ public async Task Add(ServiceControlNewInstance details, Func Update(ServiceControlInstance instance, bool startService) { instance.ReportCard = new ReportCard(); - await instance.ValidateChanges().ConfigureAwait(false); + await instance.ValidateChanges(); if (instance.ReportCard.HasErrors) { return false; diff --git a/src/ServiceControlInstaller.Engine/Validation/AbstractCommandChecks.cs b/src/ServiceControlInstaller.Engine/Validation/AbstractCommandChecks.cs index 8400dec2b2..71db1f8a81 100644 --- a/src/ServiceControlInstaller.Engine/Validation/AbstractCommandChecks.cs +++ b/src/ServiceControlInstaller.Engine/Validation/AbstractCommandChecks.cs @@ -26,12 +26,12 @@ public abstract class AbstractCommandChecks public async Task CanAddInstance() { // Check for license - if (!await IsLicenseOk().ConfigureAwait(false)) + if (!await IsLicenseOk()) { return false; } - if (await OldVersionOfServiceControlInstalled().ConfigureAwait(false)) + if (await OldVersionOfServiceControlInstalled()) { return false; } @@ -47,7 +47,7 @@ public async Task ValidateNewInstance(params IServiceInstance[] instances) .Select(i => i.TransportPackage) .First(t => t is not null); - var continueInstall = await RabbitMqCheckIsOK(transport, Constants.CurrentVersion, false).ConfigureAwait(false); + var continueInstall = await RabbitMqCheckIsOK(transport, Constants.CurrentVersion, false); return continueInstall; } @@ -68,14 +68,14 @@ async Task CanEditOrDelete(BaseService instance, bool isDelete) { var verb = isDelete ? "remove" : "edit"; var message = $"This instance version {instanceVersion} is newer than the installer version {Constants.CurrentVersion}. This installer can only {verb} instances with versions between {Constants.CurrentVersion.Major}.0.0 and {Constants.CurrentVersion}."; - await NotifyError(title, message).ConfigureAwait(false); + await NotifyError(title, message); return false; } if (installerOfDifferentMajor && !isDelete) { var message = $"This installer cannot edit instances created by a different major version. A {instanceVersion.Major}.* installer version greater or equal to {instanceVersion.Major}.{instanceVersion.Minor}.{instanceVersion.Patch} must be used instead."; - await NotifyError(title, message).ConfigureAwait(false); + await NotifyError(title, message); return false; } @@ -99,18 +99,18 @@ async Task RabbitMqCheckIsOK(TransportInfo transport, SemanticVersion inst return true; } - return await PromptForRabbitMqCheck(isUpgrade).ConfigureAwait(false); + return await PromptForRabbitMqCheck(isUpgrade); } public async Task CanUpgradeInstance(BaseService instance, bool forceUpgradeDb = false) { // Check for license - if (!await IsLicenseOk().ConfigureAwait(false)) + if (!await IsLicenseOk()) { return false; } - if (await OldVersionOfServiceControlInstalled().ConfigureAwait(false)) + if (await OldVersionOfServiceControlInstalled()) { return false; } @@ -119,7 +119,7 @@ public async Task CanUpgradeInstance(BaseService instance, bool forceUpgra var cantUpdateTransport = instance.TransportPackage.Removed && instance.TransportPackage.AutoMigrateTo is null; if (cantUpdateTransport) { - await NotifyForDeprecatedMessageTransport(instance.TransportPackage).ConfigureAwait(false); + await NotifyForDeprecatedMessageTransport(instance.TransportPackage); return false; } @@ -134,11 +134,11 @@ public async Task CanUpgradeInstance(BaseService instance, bool forceUpgra if (!forceUpgradeAllowed) { - await NotifyError("Cannot run the command", "Only ServiceControl 4.x primary instances that use RavenDB 3.5 persistence can be force-upgraded.").ConfigureAwait(false); + await NotifyError("Cannot run the command", "Only ServiceControl 4.x primary instances that use RavenDB 3.5 persistence can be force-upgraded."); return false; } - if (!await PromptToContinueWithForcedUpgrade().ConfigureAwait(false)) + if (!await PromptToContinueWithForcedUpgrade()) { return false; } @@ -149,7 +149,7 @@ public async Task CanUpgradeInstance(BaseService instance, bool forceUpgra if (!compatibleStorageEngine) { - await NotifyForIncompatibleStorageEngine(baseInstance).ConfigureAwait(false); + await NotifyForIncompatibleStorageEngine(baseInstance); return false; } } @@ -159,12 +159,12 @@ public async Task CanUpgradeInstance(BaseService instance, bool forceUpgra var upgradeInfo = UpgradeInfo.GetUpgradePathFor(instance.Version); if (upgradeInfo.HasIncompatibleVersion) { - await NotifyForIncompatibleUpgradeVersion(upgradeInfo).ConfigureAwait(false); + await NotifyForIncompatibleUpgradeVersion(upgradeInfo); return false; } } - if (!await RabbitMqCheckIsOK(instance.TransportPackage, instance.Version, isUpgrade: true).ConfigureAwait(false)) + if (!await RabbitMqCheckIsOK(instance.TransportPackage, instance.Version, isUpgrade: true)) { return false; } @@ -177,7 +177,7 @@ async Task OldVersionOfServiceControlInstalled() if (OldScmuCheck.OldVersionOfServiceControlInstalled(out var installedVersion)) { var message = $"An old version {installedVersion} of ServiceControl Management is installed, which will not work after installing new instances. Before installing ServiceControl 5 instances, you must either uninstall the {installedVersion} instance or update it to a 4.x version at least {OldScmuCheck.MinimumScmuVersion}."; - await NotifyError("Outdated Version Installed", message).ConfigureAwait(false); + await NotifyError("Outdated Version Installed", message); return true; } @@ -189,7 +189,7 @@ async Task IsLicenseOk() var licenseCheckResult = CheckLicenseIsValid(); if (!licenseCheckResult.Valid) { - await NotifyError("License Error", $"Upgrade could not continue due to an issue with the current license. {licenseCheckResult.Message}. Contact contact@particular.net").ConfigureAwait(false); + await NotifyError("License Error", $"Upgrade could not continue due to an issue with the current license. {licenseCheckResult.Message}. Contact contact@particular.net"); return false; } @@ -203,7 +203,7 @@ public async Task StopBecauseInstanceIsRunning(BaseService instance) return false; } - var proceed = await PromptToStopRunningInstance(instance).ConfigureAwait(false); + var proceed = await PromptToStopRunningInstance(instance); return !proceed; } diff --git a/src/ServiceControlInstaller.Engine/Validation/PathsValidator.cs b/src/ServiceControlInstaller.Engine/Validation/PathsValidator.cs index b24eec3886..2f5c76b13f 100644 --- a/src/ServiceControlInstaller.Engine/Validation/PathsValidator.cs +++ b/src/ServiceControlInstaller.Engine/Validation/PathsValidator.cs @@ -69,7 +69,7 @@ public async Task RunValidation(bool includeNewInstanceChecks, Func CheckPathsAreEmpty(Func> promptToProceed) if (directory.EnumerateFileSystemInfos().Any()) { - var shouldProceed = await promptToProceed(pathInfo).ConfigureAwait(false); + var shouldProceed = await promptToProceed(pathInfo); if (!shouldProceed) { return true; From e8411f2fed8274ec95d60f680b79ada0a1c0a6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 20 Mar 2025 08:59:58 +0100 Subject: [PATCH 2/3] Cleanup --- src/ServiceControl.DomainEvents/DomainEvents.cs | 6 ++---- .../ServiceControl.Monitoring.csproj | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ServiceControl.DomainEvents/DomainEvents.cs b/src/ServiceControl.DomainEvents/DomainEvents.cs index e3b85fb206..3925932754 100644 --- a/src/ServiceControl.DomainEvents/DomainEvents.cs +++ b/src/ServiceControl.DomainEvents/DomainEvents.cs @@ -20,8 +20,7 @@ public async Task Raise(T domainEvent, CancellationToken cancellationToken) w { try { - await handler.Handle(domainEvent, cancellationToken) - ; + await handler.Handle(domainEvent, cancellationToken); } catch (Exception e) { @@ -35,8 +34,7 @@ await handler.Handle(domainEvent, cancellationToken) { try { - await handler.Handle(domainEvent, cancellationToken) - ; + await handler.Handle(domainEvent, cancellationToken); } catch (Exception e) { diff --git a/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj b/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj index 59507d6bac..6edb4cd7ef 100644 --- a/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj +++ b/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj @@ -41,9 +41,5 @@ - - - - - + \ No newline at end of file From 6e880a502b45a5f4de453053f11f3b58317c1348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Thu, 20 Mar 2025 09:06:39 +0100 Subject: [PATCH 3/3] Formatting --- src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj b/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj index 6edb4cd7ef..35246ea1b8 100644 --- a/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj +++ b/src/ServiceControl.Monitoring/ServiceControl.Monitoring.csproj @@ -41,5 +41,5 @@ - + \ No newline at end of file