Update silo
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using Discord.Commands;
|
||||
using Discord.WebSocket;
|
||||
using FluentValidation;
|
||||
@@ -125,6 +126,20 @@ public static class ApiBootstrap
|
||||
// Configure networking for better silo communication
|
||||
siloBuilder
|
||||
.ConfigureEndpoints(siloPort: 11111, gatewayPort: 30000, advertisedIP: null, listenOnAnyHostAddress: true)
|
||||
.Configure<EndpointOptions>(options =>
|
||||
{
|
||||
// Set the advertised IP address for clustering
|
||||
var advertisedIP = Environment.GetEnvironmentVariable("ORLEANS_ADVERTISED_IP");
|
||||
if (!string.IsNullOrEmpty(advertisedIP) && IPAddress.TryParse(advertisedIP, out var ipAddress))
|
||||
{
|
||||
options.AdvertisedIPAddress = ipAddress;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback to localhost for single-node deployments or when clustering is disabled
|
||||
options.AdvertisedIPAddress = disableOrleansClustering ? IPAddress.Loopback : IPAddress.Any;
|
||||
}
|
||||
})
|
||||
.Configure<ClusterOptions>(options =>
|
||||
{
|
||||
// Configure cluster options with unique identifiers
|
||||
|
||||
Reference in New Issue
Block a user