✨ Registrar manual host
This commit is contained in:
@@ -130,6 +130,12 @@ public class ServiceRegistrarHostedService(
|
||||
|
||||
public async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var manualHost = configuration.GetValue<string>("SERVICE_HOST");
|
||||
if (manualHost is not null)
|
||||
{
|
||||
_opts.Host = manualHost;
|
||||
}
|
||||
|
||||
var grpcPort = int.Parse(configuration.GetValue("GRPC_PORT", "5000"));
|
||||
await registrar.RegisterAsync(_opts.Name, "grpc", _opts.InstanceId, _opts.Host, grpcPort);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user