From aa2838c27a7e38ecb10f29a990e7a6d736e130ef Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 9 Jul 2021 15:12:34 +0200 Subject: [PATCH] move client::pull to server::pull it's not used by the client and not part of the client, it just makes use *of* the client, but is used on the datastore/server... Signed-off-by: Wolfgang Bumiller --- src/api2/pull.rs | 10 ++++++---- src/client/mod.rs | 2 -- src/server/mod.rs | 2 ++ src/{client => server}/pull.rs | 0 4 files changed, 8 insertions(+), 6 deletions(-) rename src/{client => server}/pull.rs (100%) diff --git a/src/api2/pull.rs b/src/api2/pull.rs index 101ab308..0998e9b8 100644 --- a/src/api2/pull.rs +++ b/src/api2/pull.rs @@ -7,10 +7,12 @@ use futures::{select, future::FutureExt}; use proxmox::api::api; use proxmox::api::{ApiMethod, Router, RpcEnvironment, Permission}; -use crate::server::{WorkerTask, jobstate::Job}; +use crate::server::{WorkerTask, jobstate::Job, pull::pull_store}; use crate::backup::DataStore; -use crate::client::{HttpClient, BackupRepository, pull::pull_store}; -use crate::api2::types::*; +use crate::client::{HttpClient, BackupRepository}; +use crate::api2::types::{ + DATASTORE_SCHEMA, REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, Authid, +}; use crate::config::{ remote, sync::SyncJobConfig, @@ -98,7 +100,7 @@ pub fn do_sync_job( worker.log(format!("Sync datastore '{}' from '{}/{}'", sync_job.store, sync_job.remote, sync_job.remote_store)); - crate::client::pull::pull_store(&worker, &client, &src_repo, tgt_store.clone(), delete, sync_owner).await?; + pull_store(&worker, &client, &src_repo, tgt_store.clone(), delete, sync_owner).await?; worker.log(format!("sync job '{}' end", &job_id)); diff --git a/src/client/mod.rs b/src/client/mod.rs index 1eae7dd1..831d7a5a 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -43,8 +43,6 @@ pub use backup_repo::*; mod backup_specification; pub use backup_specification::*; -pub mod pull; - /// Connect to localhost:8007 as root@pam /// /// This automatically creates a ticket if run as 'root' user. diff --git a/src/server/mod.rs b/src/server/mod.rs index b0191e0e..2a01cebe 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -93,6 +93,8 @@ pub mod ticket; pub mod auth; +pub mod pull; + pub(crate) async fn reload_proxy_certificate() -> Result<(), Error> { let proxy_pid = crate::server::read_pid(pbs_buildcfg::PROXMOX_BACKUP_PROXY_PID_FN)?; let sock = crate::server::ctrl_sock_from_pid(proxy_pid); diff --git a/src/client/pull.rs b/src/server/pull.rs similarity index 100% rename from src/client/pull.rs rename to src/server/pull.rs