🔊 Add log when using manual host to register
This commit is contained in:
@@ -3,6 +3,7 @@ using Etcdserverpb;
|
|||||||
using Google.Protobuf;
|
using Google.Protobuf;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace DysonNetwork.Shared.Registry;
|
namespace DysonNetwork.Shared.Registry;
|
||||||
@@ -122,7 +123,8 @@ public sealed class ServiceRegistrationOptions
|
|||||||
public class ServiceRegistrarHostedService(
|
public class ServiceRegistrarHostedService(
|
||||||
ServiceRegistrar registrar,
|
ServiceRegistrar registrar,
|
||||||
IConfiguration configuration,
|
IConfiguration configuration,
|
||||||
IOptions<ServiceRegistrationOptions> options
|
IOptions<ServiceRegistrationOptions> options,
|
||||||
|
ILogger<ServiceRegistrar> logger
|
||||||
)
|
)
|
||||||
: IHostedService
|
: IHostedService
|
||||||
{
|
{
|
||||||
@@ -133,6 +135,7 @@ public class ServiceRegistrarHostedService(
|
|||||||
var manualHost = configuration.GetValue<string>("SERVICE_HOST");
|
var manualHost = configuration.GetValue<string>("SERVICE_HOST");
|
||||||
if (manualHost is not null)
|
if (manualHost is not null)
|
||||||
{
|
{
|
||||||
|
logger.LogInformation($"Will register with manual host: {manualHost}");
|
||||||
_opts.Host = manualHost;
|
_opts.Host = manualHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user