chore: protect external runtime connection settings
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Failing after 16s
Validators (Pushes and Pull Requests) / validate-core (push) Failing after 54s

This commit is contained in:
2026-07-12 12:19:34 +09:00
parent a7f9b27a55
commit 606664404b
6 changed files with 58 additions and 14 deletions
-6
View File
@@ -81,12 +81,6 @@ try
// PostgreSQL Dapper Setup
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection")
?? throw new InvalidOperationException("Connection string 'DefaultConnection' is required.");
if (builder.Environment.IsProduction()
&& string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ConnectionStrings__DefaultConnection")))
{
throw new InvalidOperationException(
"Production requires ConnectionStrings__DefaultConnection from the service environment.");
}
var configuredDatabase = new NpgsqlConnectionStringBuilder(connectionString).Database;
if (!string.Equals(configuredDatabase, "quantenginedb", StringComparison.OrdinalIgnoreCase))