pagination for backtest and optimization

This commit is contained in:
2025-07-16 14:27:07 +07:00
parent 11778aa2a4
commit f51fd5a5f7
15 changed files with 287 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ using Managing.Bootstrap;
using Managing.Common;
using Managing.Core.Middleawares;
using Managing.Infrastructure.Databases.InfluxDb.Models;
using Managing.Infrastructure.Databases.MongoDb;
using Managing.Infrastructure.Databases.MongoDb.Configurations;
using Managing.Infrastructure.Evm.Models.Privy;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
@@ -156,6 +157,19 @@ builder.WebHost.SetupDiscordBot();
var app = builder.Build();
app.UseSerilogRequestLogging();
// Create MongoDB indexes on startup
try
{
var indexService = app.Services.GetRequiredService<IndexService>();
await indexService.CreateIndexesAsync();
}
catch (Exception ex)
{
// Log the error but don't fail the application startup
var logger = app.Services.GetRequiredService<ILogger<Program>>();
logger.LogError(ex, "Failed to create MongoDB indexes on startup. The application will continue without indexes.");
}
if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();