From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 99B291FF15E for ; Tue, 28 Jan 2025 13:25:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B18F0CC59; Tue, 28 Jan 2025 13:25:54 +0100 (CET) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Date: Tue, 28 Jan 2025 13:25:11 +0100 Message-Id: <20250128122520.167796-7-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250128122520.167796-1-l.wagner@proxmox.com> References: <20250128122520.167796-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pdm-devel] [PATCH proxmox-datacenter-manager 06/15] remote tasks: move to dir based module X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" The module is becoming quite large at this point, a dir based module allows us to split it apart in future commits. No functional changes. Signed-off-by: Lukas Wagner --- server/src/api/pve/mod.rs | 4 ++-- server/src/api/remote_tasks.rs | 4 ++-- server/src/lib.rs | 2 +- server/src/{task_cache.rs => remote_tasks/mod.rs} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename server/src/{task_cache.rs => remote_tasks/mod.rs} (100%) diff --git a/server/src/api/pve/mod.rs b/server/src/api/pve/mod.rs index 2cefbb4..c328675 100644 --- a/server/src/api/pve/mod.rs +++ b/server/src/api/pve/mod.rs @@ -27,7 +27,7 @@ use pve_api_types::{ use super::resources::{map_pve_lxc, map_pve_node, map_pve_qemu, map_pve_storage}; -use crate::{connection, task_cache}; +use crate::{connection, remote_tasks}; mod lxc; mod node; @@ -76,7 +76,7 @@ const STATUS_ROUTER: Router = Router::new().get(&API_METHOD_CLUSTER_STATUS); // converts a remote + PveUpid into a RemoteUpid and starts tracking it fn new_remote_upid(remote: String, upid: PveUpid) -> Result { let remote_upid: RemoteUpid = (remote, upid.to_string()).try_into()?; - task_cache::track_running_task(remote_upid.clone()); + remote_tasks::track_running_task(remote_upid.clone()); Ok(remote_upid) } diff --git a/server/src/api/remote_tasks.rs b/server/src/api/remote_tasks.rs index da3b718..05ce366 100644 --- a/server/src/api/remote_tasks.rs +++ b/server/src/api/remote_tasks.rs @@ -4,7 +4,7 @@ use proxmox_router::{list_subdirs_api_method, Permission, Router, SubdirMap}; use proxmox_schema::api; use proxmox_sortable_macro::sortable; -use crate::task_cache; +use crate::remote_tasks; pub const ROUTER: Router = Router::new() .get(&list_subdirs_api_method!(SUBDIRS)) @@ -30,7 +30,7 @@ const SUBDIRS: SubdirMap = &sorted!([("list", &Router::new().get(&API_METHOD_LIS )] /// Get the list of tasks for all remotes. async fn list_tasks(filters: TaskFilters) -> Result, Error> { - let tasks = task_cache::get_tasks(filters).await?; + let tasks = remote_tasks::get_tasks(filters).await?; Ok(tasks) } diff --git a/server/src/lib.rs b/server/src/lib.rs index 143ee32..4320e46 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -6,8 +6,8 @@ pub mod auth; pub mod context; pub mod env; pub mod metric_collection; +pub mod remote_tasks; pub mod resource_cache; -pub mod task_cache; pub mod task_utils; pub mod connection; diff --git a/server/src/task_cache.rs b/server/src/remote_tasks/mod.rs similarity index 100% rename from server/src/task_cache.rs rename to server/src/remote_tasks/mod.rs -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel