From c7d54aedcf211f6435c0cc42394b04b344213368 Mon Sep 17 00:00:00 2001 From: George Drak Date: Wed, 13 Jan 2021 13:19:09 +0500 Subject: [PATCH] Allow configure health check path --- src/Sitko.Core.Consul.Web/ConsulWebClient.cs | 2 +- src/Sitko.Core.Consul.Web/ConsulWebModuleConfig.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Sitko.Core.Consul.Web/ConsulWebClient.cs b/src/Sitko.Core.Consul.Web/ConsulWebClient.cs index daf603a3..365bab6b 100644 --- a/src/Sitko.Core.Consul.Web/ConsulWebClient.cs +++ b/src/Sitko.Core.Consul.Web/ConsulWebClient.cs @@ -72,7 +72,7 @@ public ConsulWebClient(IServer server, IConsulClient consulClient, ConsulWebModu _uri = address; } - _healthUrl = $"{_uri.Scheme}://{_uri.Host}:{_uri.Port}/health"; + _healthUrl = new Uri(_uri, _config.HealthCheckPath).ToString(); } public async Task RegisterAsync() diff --git a/src/Sitko.Core.Consul.Web/ConsulWebModuleConfig.cs b/src/Sitko.Core.Consul.Web/ConsulWebModuleConfig.cs index 42966a85..1bd28558 100644 --- a/src/Sitko.Core.Consul.Web/ConsulWebModuleConfig.cs +++ b/src/Sitko.Core.Consul.Web/ConsulWebModuleConfig.cs @@ -11,5 +11,6 @@ public class ConsulWebModuleConfig : ConsulModuleConfig public TimeSpan DeregisterTimeout { get; set; } = TimeSpan.FromSeconds(60); public bool AutoFixRegistration { get; set; } = false; + public string HealthCheckPath { get; set; } = "/health"; } }