fix: tests and config.rs and backup.rs args

This commit is contained in:
Charles GTE
2026-06-20 14:36:09 +02:00
parent 273475fa3b
commit 1fece577cc
11 changed files with 19 additions and 2 deletions
+2
View File
@@ -47,6 +47,8 @@ pub async fn run(
.arg("--triggers")
.arg("--verbose")
.arg("--single-transaction")
.arg("--set-gtid-purged=OFF")
.arg("--no-tablespaces")
.arg("--quick")
.arg("--skip-lock-tables")
.arg("--skip-add-drop-table")
-1
View File
@@ -3,7 +3,6 @@ use async_trait::async_trait;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use tracing::info;
use super::{backup, format::PostgresDumpFormat, ping, restore};
use crate::domain::factory::Database;
use crate::services::backup::logger::JobLogger;
+8 -1
View File
@@ -216,6 +216,13 @@ impl ConfigService {
_ => optional(&db.path),
};
let max_packet_size = match db.db_type {
DbType::Mysql | DbType::Mariadb => {
db.max_packet_size.unwrap_or_else(|| "512M".to_string())
}
_ => String::new(),
};
databases.push(DatabaseConfig {
name: db.name,
database: database_name,
@@ -226,7 +233,7 @@ impl ConfigService {
port,
generated_id: db.generated_id,
path: path_val,
max_packet_size: db.max_packet_size.unwrap_or_else(|| "512M".to_string()),
max_packet_size,
});
}
+1
View File
@@ -39,6 +39,7 @@ async fn create_config() -> (ContainerAsync<GenericImage>, DatabaseConfig) {
host,
generated_id: "3c445eb4-c2c6-4bde-a423-ee1385dcf6d2".to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
};
(container, config)
+1
View File
@@ -31,6 +31,7 @@ async fn create_config() -> (ContainerAsync<Mariadb>, DatabaseConfig) {
host: host.to_string(),
generated_id: "3c4b4eb4-c2c6-4bde-a423-ee1385dcf6d2".to_string(),
path: "".to_string(),
max_packet_size: "512M".to_string(),
};
(container, config)
+1
View File
@@ -29,6 +29,7 @@ async fn create_config() -> (ContainerAsync<Mongo>, DatabaseConfig) {
host: host.to_string(),
generated_id: "96d30a9f-ff4b-47c9-aaab-f3147bb34f16".to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
};
(container, config)
+1
View File
@@ -54,6 +54,7 @@ fn make_config(host: String, port: u16, database: &str, generated_id: &str) -> D
host,
generated_id: generated_id.to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
}
}
+1
View File
@@ -31,6 +31,7 @@ async fn create_config() -> (ContainerAsync<Mysql>, DatabaseConfig) {
host: host.to_string(),
generated_id: "0f1bb8f2-35a0-4c91-8098-e36873d3ce31".to_string(),
path: "".to_string(),
max_packet_size: "512M".to_string(),
};
(container, config)
+2
View File
@@ -38,6 +38,7 @@ async fn create_config() -> (ContainerAsync<Postgres>, DatabaseConfig) {
host: host.to_string(),
generated_id: "40875631-e3d2-4dfe-a26b-2a347ecc64fd".to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
};
(container, config)
@@ -140,6 +141,7 @@ async fn postgres_password_with_slash_test() {
host: host.to_string(),
generated_id: "5a1f0e3c-9b8a-4a8e-9b1b-0a1c2d3e4f5a".to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
};
let db = DatabaseFactory::create_for_backup(config.clone()).await;
+1
View File
@@ -28,6 +28,7 @@ async fn create_config() -> (ContainerAsync<Redis>, DatabaseConfig) {
host: host.to_string(),
generated_id: "40875631-e3d2-4dfe-a26b-2a347ecc64fd".to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
};
(container, config)
+1
View File
@@ -27,6 +27,7 @@ async fn create_config() -> (ContainerAsync<Valkey>, DatabaseConfig) {
host: host.to_string(),
generated_id: "40875485-e3d2-4dfe-a26b-2a347ecc64fd".to_string(),
path: "".to_string(),
max_packet_size: "".to_string(),
};
(container, config)