mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-09 14:47:59 -05:00
include ; for timeout string
This commit is contained in:
parent
e0ef55a636
commit
9ed3e50a63
@ -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