mirror of
https://github.com/Portabase/agent.git
synced 2026-09-10 01:57:10 +00:00
Added config options for setting timeouts on mysql/mariadb
This commit is contained in:
@@ -50,7 +50,7 @@ pub async fn run(
|
||||
.arg("--skip-add-drop-table")
|
||||
.arg("--compress")
|
||||
.arg("--verbose")
|
||||
.arg("--max-allowed-packet=512M")
|
||||
.arg(format!("--max-allowed-packet={}", cfg.max_allowed_packet))
|
||||
.arg("--net-buffer-length=16K")
|
||||
.arg("--default-character-set=utf8mb4")
|
||||
.arg(&cfg.database)
|
||||
|
||||
@@ -48,6 +48,9 @@ pub async fn run(
|
||||
.arg("--skip-add-drop-table")
|
||||
.arg("--no-create-db")
|
||||
.arg("--default-character-set=utf8mb4")
|
||||
.arg(format!("--net-read-timeout={}", cfg.net_read_timeout))
|
||||
.arg(format!("--net-write-timeout={}", cfg.net_write_timeout))
|
||||
.arg(format!("--max-allowed-packet={}", cfg.max_allowed_packet))
|
||||
.arg(&cfg.database)
|
||||
.arg("-r").arg(&file_path)
|
||||
.envs(env)
|
||||
|
||||
@@ -54,6 +54,9 @@ pub struct DatabaseConfig {
|
||||
pub host: String,
|
||||
pub generated_id: String,
|
||||
pub path: String,
|
||||
pub net_read_timeout: u32,
|
||||
pub net_write_timeout: u32,
|
||||
pub max_allowed_packet: String,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
@@ -75,6 +78,9 @@ pub struct InputDatabaseConfig {
|
||||
pub host: Option<String>,
|
||||
pub generated_id: String,
|
||||
pub path: Option<String>,
|
||||
pub net_read_timeout: Option<u32>,
|
||||
pub net_write_timeout: Option<u32>,
|
||||
pub max_allowed_packet: Option<String>,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
@@ -224,6 +230,9 @@ impl ConfigService {
|
||||
port,
|
||||
generated_id: db.generated_id,
|
||||
path: path_val,
|
||||
net_read_timeout: db.net_read_timeout.unwrap_or(3600),
|
||||
net_write_timeout: db.net_write_timeout.unwrap_or(3600),
|
||||
max_allowed_packet: db.max_allowed_packet.unwrap_or_else(|| "512M".to_string()),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user