include ; for timeout string
This commit is contained in:
parent
36a02b3d7b
commit
b2d282d412
@ -74,14 +74,14 @@ namespace IW4MAdmin.Application.Extensions
|
|||||||
StringComparison.InvariantCultureIgnoreCase);
|
StringComparison.InvariantCultureIgnoreCase);
|
||||||
services.AddDbContext<DatabaseContext, MySqlDatabaseContext>(options =>
|
services.AddDbContext<DatabaseContext, MySqlDatabaseContext>(options =>
|
||||||
options.UseMySql(
|
options.UseMySql(
|
||||||
appConfig.ConnectionString + (appendTimeout ? "default command timeout=0" : ""),
|
appConfig.ConnectionString + (appendTimeout ? ";default command timeout=0" : ""),
|
||||||
mysqlOptions => mysqlOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);
|
mysqlOptions => mysqlOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
appendTimeout = !appConfig.ConnectionString.Contains("Command Timeout",
|
appendTimeout = !appConfig.ConnectionString.Contains("Command Timeout",
|
||||||
StringComparison.InvariantCultureIgnoreCase);
|
StringComparison.InvariantCultureIgnoreCase);
|
||||||
services.AddDbContext<DatabaseContext, PostgresqlDatabaseContext>(options =>
|
services.AddDbContext<DatabaseContext, PostgresqlDatabaseContext>(options =>
|
||||||
options.UseNpgsql(appConfig.ConnectionString + (appendTimeout ? "Command Timeout=0" : ""),
|
options.UseNpgsql(appConfig.ConnectionString + (appendTimeout ? ";Command Timeout=0" : ""),
|
||||||
postgresqlOptions => postgresqlOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);
|
postgresqlOptions => postgresqlOptions.EnableRetryOnFailure()), ServiceLifetime.Transient);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user