fix: harden mariadb startup and shared networking
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user