Try fixing orleans server runtime
This commit is contained in:
@@ -45,6 +45,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Orleans.Configuration;
|
||||
|
||||
namespace Managing.Bootstrap;
|
||||
|
||||
@@ -100,9 +101,22 @@ public static class ApiBootstrap
|
||||
}
|
||||
|
||||
siloBuilder
|
||||
.ConfigureLogging(logging => logging.SetMinimumLevel(LogLevel.Information))
|
||||
.UseDashboard(options => { })
|
||||
.AddMemoryGrainStorageAsDefault()
|
||||
.ConfigureLogging(logging => logging.SetMinimumLevel(LogLevel.Information));
|
||||
|
||||
// Only enable dashboard in development to avoid shutdown issues
|
||||
if (!isProduction)
|
||||
{
|
||||
siloBuilder.UseDashboard(options =>
|
||||
{
|
||||
// Configure dashboard with proper shutdown handling
|
||||
options.Port = 8080;
|
||||
options.HostSelf = true;
|
||||
options.CounterUpdateIntervalMs = 10000; // 10 seconds
|
||||
options.HideTrace = true; // Hide trace to reduce dashboard overhead
|
||||
});
|
||||
}
|
||||
|
||||
siloBuilder.AddMemoryGrainStorageAsDefault()
|
||||
.ConfigureServices(services =>
|
||||
{
|
||||
// Register existing services for Orleans DI
|
||||
@@ -112,6 +126,12 @@ public static class ApiBootstrap
|
||||
services.AddTransient<ITradingService, TradingService>();
|
||||
services.AddTransient<IMessengerService, MessengerService>();
|
||||
services.AddTransient<IBackupBotService, BackupBotService>();
|
||||
})
|
||||
.Configure<ClusterOptions>(options =>
|
||||
{
|
||||
// Configure cluster options
|
||||
options.ServiceId = "ManagingApp";
|
||||
options.ClusterId = configuration["ASPNETCORE_ENVIRONMENT"] ?? "Development";
|
||||
});
|
||||
})
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user