From e2d7c4747e7779438e4d1cee2ef7a8132e8aa863 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Tue, 10 Feb 2026 20:08:00 +0100 Subject: [PATCH] feat: Ready for Testing. --- src/services/api/endpoints/agent/status.rs | 26 ------------------- src/services/backup.rs | 4 +-- src/services/restore.rs | 6 ++--- .../storage/providers/google_drive/mod.rs | 2 +- 4 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/services/api/endpoints/agent/status.rs b/src/services/api/endpoints/agent/status.rs index 80f56e5..fe05790 100644 --- a/src/services/api/endpoints/agent/status.rs +++ b/src/services/api/endpoints/agent/status.rs @@ -19,32 +19,6 @@ pub struct StatusRequest<'a> { pub databases: Vec>, } -// impl ApiClient { -// // pub async fn agent_status(&self, agent_id: impl Into) -> Result { -// // let agent_id = agent_id.into(); -// // let path = format!("/agent/{}/status", agent_id); -// // self.request(Method::GET, path.as_str()).await -// // } -// -// pub async fn agent_status<'a>( -// &self, -// agent_id: impl Into, -// version: &'static str, -// databases: Vec>, -// ) -> Result { -// -// let body = StatusRequest { -// version, -// databases, -// }; -// -// let agent_id = agent_id.into(); -// let path = format!("/agent/{}/status", agent_id); -// -// self.request_with_body(Method::POST, path.as_str(), &body).await -// } -// } - impl ApiClient { pub async fn agent_status<'a>( &self, diff --git a/src/services/backup.rs b/src/services/backup.rs index f39f3d5..73acf06 100644 --- a/src/services/backup.rs +++ b/src/services/backup.rs @@ -13,7 +13,7 @@ use std::path::{Path, PathBuf}; use std::sync::Arc; use tempfile::TempDir; use tracing::{error, info}; -use crate::utils::locks::{DbOpLock, FileLock}; +use crate::utils::locks::FileLock; #[derive(Debug, Clone)] pub struct BackupResult { @@ -375,7 +375,7 @@ impl BackupService { .backup_update(self.ctx.edge_key.agent_id.clone(), backup_id, status, file_size, &result.generated_id) .await { - Ok(result) => Ok(()), + Ok(_result) => Ok(()), Err(e) => { error!( "backup_update failed (generated_id={}, backup_id={}): {}", diff --git a/src/services/restore.rs b/src/services/restore.rs index 02e5bac..68cfcc8 100644 --- a/src/services/restore.rs +++ b/src/services/restore.rs @@ -53,7 +53,7 @@ impl RestoreService { } Err(e) => error!("Restoration error {}", e), } - // TempDir is automatically deleted when dropped here + // TempDir is automatically deleted when dropped } Err(e) => error!("Failed to create temp dir: {}", e), } @@ -86,10 +86,9 @@ impl RestoreService { tokio::fs::write(&compressed_archive, &bytes).await?; info!("Backup downloaded to {}", compressed_archive.display()); - let decompressed_files = decompress_large_tar_gz(compressed_archive.as_path(), tmp_path).await?; - info!("decompressed_files {:#?}", decompressed_files); + info!("Decompressed_files {:#?}", decompressed_files); if decompressed_files.is_empty() { return Ok(RestoreResult { @@ -104,7 +103,6 @@ impl RestoreService { compressed_archive.as_path() }; - info!("Decompressed file {}", backup_file_path.display()); let db_instance = DatabaseFactory::create_for_restore(cfg.clone(), &backup_file_path).await; diff --git a/src/services/storage/providers/google_drive/mod.rs b/src/services/storage/providers/google_drive/mod.rs index afb1258..c66f65c 100644 --- a/src/services/storage/providers/google_drive/mod.rs +++ b/src/services/storage/providers/google_drive/mod.rs @@ -100,7 +100,7 @@ impl StorageProvider for GoogleDriveProvider { total_size, Some("application/octet-stream"), ).await { - Ok(file_id) => { + Ok(_file_id) => { info!("Google Drive upload successful");