mirror of
https://github.com/Portabase/agent.git
synced 2026-09-11 14:00:14 +00:00
feat: Ready for Testing.
This commit is contained in:
@@ -19,32 +19,6 @@ pub struct StatusRequest<'a> {
|
||||
pub databases: Vec<DatabasePayload<'a>>,
|
||||
}
|
||||
|
||||
// impl ApiClient {
|
||||
// // pub async fn agent_status(&self, agent_id: impl Into<String>) -> Result<PingResult, ApiError> {
|
||||
// // 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<String>,
|
||||
// version: &'static str,
|
||||
// databases: Vec<DatabasePayload<'a>>,
|
||||
// ) -> Result<PingResult, ApiError> {
|
||||
//
|
||||
// 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,
|
||||
|
||||
@@ -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={}): {}",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user