OPC # 0002: Fix issue from docker root directory change
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -32,9 +32,10 @@ builder.Services.AddSingleton<PromotionService>();
|
||||
// OPC persistence (raw Npgsql)
|
||||
var opcConnStr = builder.Configuration.GetConnectionString("opcdb");
|
||||
if (!string.IsNullOrWhiteSpace(opcConnStr))
|
||||
builder.Services.AddSingleton(NpgsqlDataSource.Create(opcConnStr));
|
||||
// Replace 'localhost' with '127.0.0.1' to avoid Npgsql trying [::1] first on Windows
|
||||
builder.Services.AddSingleton(NpgsqlDataSource.Create(opcConnStr.Replace("localhost", "127.0.0.1")));
|
||||
else
|
||||
builder.Services.AddSingleton(NpgsqlDataSource.Create("Host=localhost;Database=opcdb;Username=postgres;Password=controlplane-dev"));
|
||||
builder.Services.AddSingleton(NpgsqlDataSource.Create("Host=127.0.0.1;Port=5433;Database=opcdb;Username=postgres;Password=controlplane-dev"));
|
||||
builder.Services.AddScoped<OpcService>();
|
||||
|
||||
// Named HttpClient for OpenRouter AI assist proxy
|
||||
|
||||
Reference in New Issue
Block a user