fix(web): migrate Hangfire storage from SqlServer to PostgreSql to prevent startup crash
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 10s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 8s
Deploy to Production / Build & Deploy to Production (push) Failing after 2m15s

This commit is contained in:
2026-07-05 18:45:23 +09:00
parent ef809e48de
commit 4b53a6d0cb
3 changed files with 4 additions and 7 deletions
-1
View File
@@ -23,7 +23,6 @@ using Microsoft.Extensions.Options;
using MudBlazor.Services;
using QuantEngine.Web.Services;
using Hangfire;
using Hangfire.SqlServer;
// Serilog Configuration with Telegram Sink
Log.Logger = new LoggerConfiguration()
@@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.23" />
<PackageReference Include="Hangfire.Core" Version="1.8.23" />
<PackageReference Include="Hangfire.SqlServer" Version="1.8.23" />
<PackageReference Include="Hangfire.PostgreSql" Version="1.20.10" />
<PackageReference Include="MudBlazor" Version="8.6.0" />
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.0-preview.2.25120.18" />
@@ -1,7 +1,7 @@
using Hangfire;
using Hangfire.States;
using Hangfire.Dashboard;
using Hangfire.SqlServer;
using Hangfire.PostgreSql;
using System.Linq.Expressions;
using QuantEngine.Application.Services;
using QuantEngine.Infrastructure.Data;
@@ -238,12 +238,10 @@ public static class HangfireServiceExtensions
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSqlServerStorage(connectionString, new SqlServerStorageOptions
.UsePostgreSqlStorage(options => options.UseNpgsqlConnection(connectionString), new PostgreSqlStorageOptions
{
CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.FromSeconds(15),
DisableGlobalLocks = true
PrepareSchemaIfNecessary = true
}));
// Add Hangfire server