mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-10 06:52:18 +08:00
fix(oceanbase): extend default Oracle query timeout
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"GoNavi-Wails/internal/db"
|
||||
)
|
||||
|
||||
const defaultOceanBaseOracleQueryTimeoutSeconds = 120
|
||||
|
||||
func normalizeRunConfig(config connection.ConnectionConfig, dbName string) connection.ConnectionConfig {
|
||||
runConfig := config
|
||||
name := strings.TrimSpace(dbName)
|
||||
@@ -54,6 +56,10 @@ func applyOceanBaseOracleCurrentSchemaInit(config connection.ConnectionConfig, s
|
||||
if normalizedSchema == "" {
|
||||
return config
|
||||
}
|
||||
if config.Timeout <= 0 {
|
||||
// OceanBase Oracle 查询经常需要经过 OBProxy/Oracle driver 的读等待;默认 30s 容易把慢查询误报成 driver: bad connection。
|
||||
config.Timeout = defaultOceanBaseOracleQueryTimeoutSeconds
|
||||
}
|
||||
values, err := url.ParseQuery(strings.TrimSpace(config.ConnectionParams))
|
||||
if err != nil {
|
||||
return config
|
||||
|
||||
Reference in New Issue
Block a user