perf: reduce connection timeouts to 3s and default config to Demo mode to prevent offline delays

This commit is contained in:
2026-10-20 20:40:23 +09:00
parent 45fd71fe9a
commit 8ff4021f42
4 changed files with 39 additions and 38 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ function Invoke-NetAppRestRequest {
Uri = $fullUri Uri = $fullUri
Method = $Method Method = $Method
Headers = $headers Headers = $headers
TimeoutSec = 10 TimeoutSec = 3
} }
if ($Body) { if ($Body) {
+2 -1
View File
@@ -44,7 +44,8 @@ SELECT
$useLive = if ($Config -and $Config.MsSql) { [bool]$Config.MsSql.UseLive } else { $false } $useLive = if ($Config -and $Config.MsSql) { [bool]$Config.MsSql.UseLive } else { $false }
if ($useLive) { if ($useLive) {
try { try {
$connStr = Build-SqlConnectionString -Server $Config.MsSql.Server -AuthType $Config.MsSql.AuthType -Username $Config.MsSql.Username -Password $Config.MsSql.Password $timeout = if ($Config.MsSql.ConnectionTimeout) { [int]$Config.MsSql.ConnectionTimeout } else { 3 }
$connStr = Build-SqlConnectionString -Server $Config.MsSql.Server -AuthType $Config.MsSql.AuthType -Username $Config.MsSql.Username -Password $Config.MsSql.Password -Timeout $timeout
$conn = New-Object System.Data.SqlClient.SqlConnection($connStr) $conn = New-Object System.Data.SqlClient.SqlConnection($connStr)
$conn.Open() $conn.Open()
$cmd = $conn.CreateCommand() $cmd = $conn.CreateCommand()
+1 -1
View File
@@ -81,7 +81,7 @@ function Get-SqlDatabases {
$auth = $Config.MsSql.AuthType $auth = $Config.MsSql.AuthType
$user = $Config.MsSql.Username $user = $Config.MsSql.Username
$pass = $Config.MsSql.Password $pass = $Config.MsSql.Password
$timeout = if ($Config.MsSql.ConnectionTimeout) { [int]$Config.MsSql.ConnectionTimeout } else { 10 } $timeout = if ($Config.MsSql.ConnectionTimeout) { [int]$Config.MsSql.ConnectionTimeout } else { 3 }
$connStr = Build-SqlConnectionString -Server $server -AuthType $auth -Username $user -Password $pass -Timeout $timeout $connStr = Build-SqlConnectionString -Server $server -AuthType $auth -Username $user -Password $pass -Timeout $timeout
$conn = New-Object System.Data.SqlClient.SqlConnection($connStr) $conn = New-Object System.Data.SqlClient.SqlConnection($connStr)
+35 -35
View File
@@ -1,35 +1,35 @@
{ {
"ActiveDirectory": { "Application": {
"UseLive": true, "LiveMode": false,
"DomainController": "dc01.corp.local", "Theme": "Dark",
"Domain": "corp.local", "AutoRefreshSeconds": 60
"UseLdaps": false, },
"BaseOU": "DC=corp,DC=local", "ActiveDirectory": {
"Username": "", "UseLive": false,
"Password": "" "DomainController": "dc01.corp.local",
}, "Domain": "corp.local",
"NetApp": { "BaseOU": "DC=corp,DC=local",
"UseLive": true, "UseLdaps": false,
"Password": "", "Username": "",
"IgnoreSslErrors": true, "Password": ""
"ClusterEndpoint": "https://10.200.10.50", },
"DefaultSvm": "svm_cifs_prod01", "NetApp": {
"Port": 443, "UseLive": false,
"Username": "admin" "ClusterEndpoint": "https://10.200.10.50",
}, "Port": 443,
"MsSql": { "DefaultSvm": "svm_cifs_prod01",
"AuthType": "Integrated", "Username": "admin",
"Username": "sa", "Password": "",
"BackupDirectory": "C:\\Backups", "IgnoreSslErrors": true
"DefaultDatabase": "master", },
"Password": "", "MsSql": {
"ConnectionTimeout": 10, "UseLive": false,
"UseLive": true, "Server": "localhost",
"Server": "localhost" "AuthType": "Integrated",
}, "Username": "sa",
"Application": { "Password": "",
"LiveMode": true, "DefaultDatabase": "master",
"AutoRefreshSeconds": 60, "ConnectionTimeout": 3,
"Theme": "Dark" "BackupDirectory": "C:\\Backups"
} }
} }