fix(connection): raise default connect timeout
This commit is contained in:
1 parent
ac3d3a7948
commit
7910a2f68e
9 files changed
+98
-13
No files matched your search
@@ -194,7 +194,7 @@ pub fn default_ssh_connect_timeout_secs() -> u64 {
|
||||
}
|
||||
|
||||
pub fn default_connect_timeout_secs() -> u64 {
|
||||
5
|
||||
10
|
||||
}
|
||||
|
||||
pub fn default_query_timeout_secs() -> u64 {
|
||||
@@ -1581,6 +1581,24 @@ mod tests {
|
||||
assert!(hops[0].expose_lan);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn missing_connection_timeout_defaults_to_ten_seconds() {
|
||||
let config: ConnectionConfig = serde_json::from_value(serde_json::json!({
|
||||
"id": "id",
|
||||
"name": "name",
|
||||
"db_type": "mysql",
|
||||
"host": "10.1.2.3",
|
||||
"port": 3306,
|
||||
"username": "root",
|
||||
"password": "",
|
||||
"database": null
|
||||
}))
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(config.connect_timeout_secs, 10);
|
||||
assert_eq!(config.effective_connect_timeout_secs(), 10);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn legacy_ssh_tunnels_migrate_to_ordered_transport_layers() {
|
||||
let config: ConnectionConfig = serde_json::from_value(serde_json::json!({
|
||||
|
||||
Reference in new issue
Block a user