fix: harden mariadb startup and shared networking

This commit is contained in:
cesnimda
2026-03-22 22:08:39 +01:00
parent c4bb6f1474
commit 42bc642bfa
2 changed files with 18 additions and 1 deletions
+4 -1
View File
@@ -47,7 +47,10 @@ builder.Services.AddDbContext<JobTrackerContext>((sp, options) =>
if (provider is "mysql" or "mariadb")
{
options.UseMySql(cs, ServerVersion.AutoDetect(cs));
// Avoid ServerVersion.AutoDetect here because it forces an immediate DB connection
// during service registration, which can crash the API if MariaDB is temporarily
// unavailable or on a different network during deploy startup.
options.UseMySql(cs, new MariaDbServerVersion(new Version(11, 0, 0)));
}
else
{