From aa217c732f42f41dcd694094de50dc19154f7e78 Mon Sep 17 00:00:00 2001 From: Aidar Shaikhiev Date: Thu, 19 Sep 2024 17:15:49 +0500 Subject: [PATCH] Fix consul reg when ConsulEnabled is absent in appsettings --- ATI.Services.Consul/ConsulHostedService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ATI.Services.Consul/ConsulHostedService.cs b/ATI.Services.Consul/ConsulHostedService.cs index dc0b706..165b936 100644 --- a/ATI.Services.Consul/ConsulHostedService.cs +++ b/ATI.Services.Consul/ConsulHostedService.cs @@ -15,7 +15,7 @@ public class ConsulHostedService( { public Task StartAsync(CancellationToken ct) { - if (!bool.TryParse(ConfigurationManager.AppSettings("ConsulEnabled"), out var enabled) || !enabled) + if (bool.TryParse(ConfigurationManager.AppSettings("ConsulEnabled"), out var enabled) && !enabled) return Task.CompletedTask; Console.WriteLine("ConsulHostedService is starting.");