From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1AEED1FF173 for ; Mon, 25 Nov 2024 09:58:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8E7CECE94; Mon, 25 Nov 2024 09:58:52 +0100 (CET) Date: Mon, 25 Nov 2024 09:58:18 +0100 From: Gabriel Goller To: Christian Ebner Message-ID: References: <20241122111150.162327-1-g.goller@proxmox.com> <3cc8bcda-9bc6-4658-9c9f-cfad4ef38833@proxmox.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3cc8bcda-9bc6-4658-9c9f-cfad4ef38833@proxmox.com> User-Agent: NeoMutt/20241002-35-39f9a6 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.038 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup] reuse-datastore: avoid creating another default prune job X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Cc: Proxmox Backup Server development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On 22.11.2024 12:18, Christian Ebner wrote: >On 11/22/24 12:11, Gabriel Goller wrote: >>diff --git a/src/api2/config/prune.rs b/src/api2/config/prune.rs >>index ce7b8ce565ce..dafb97e2f1e5 100644 >>--- a/src/api2/config/prune.rs >>+++ b/src/api2/config/prune.rs >>@@ -77,6 +77,21 @@ pub fn do_create_prune_job(config: PruneJobConfig) -> Result<(), Error> { >> Ok(()) >> } >>+pub fn default_prune_job_existing(datastore: &str) -> Result { >>+ let (section_config, _digest) = prune::config()?; >>+ if section_config >>+ .sections >>+ .keys() >>+ .filter(|s| s.starts_with(&format!("default-{datastore}"))) >>+ .count() >>+ > 0 >>+ { >>+ Ok(true) >>+ } else { >>+ Ok(false) >>+ } > >could be more compact? no need for the if block: > >let has_default = section_config.sections.keys().filter(...).count() > >0; >Ok(has_default) Yep, corrected it in v2! Thanks for looking at it! >>+} >>+ >> #[api( >> protected: true, >> input: { > _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel