Skip to content

Commit

Permalink
Fix consul reg when ConsulEnabled is absent in appsettings
Browse files Browse the repository at this point in the history
  • Loading branch information
muphblu committed Sep 19, 2024
1 parent 972a306 commit aa217c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ATI.Services.Consul/ConsulHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit aa217c7

Please sign in to comment.