pagination for backtest and optimization
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user