From f30757df50737d39593aa969b31cab5c5a48efab Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 15 Feb 2022 07:58:18 +0100 Subject: [PATCH] rrd: extract data: avoid always calculating start-time fallback Signed-off-by: Thomas Lamprecht --- proxmox-rrd/src/rrd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox-rrd/src/rrd.rs b/proxmox-rrd/src/rrd.rs index 5fd7d0e2..1d5d665f 100644 --- a/proxmox-rrd/src/rrd.rs +++ b/proxmox-rrd/src/rrd.rs @@ -469,7 +469,7 @@ impl RRD { match rra { Some(rra) => { let end = end.unwrap_or_else(|| proxmox_time::epoch_f64() as u64); - let start = start.unwrap_or(end.saturating_sub(10*rra.resolution)); + let start = start.unwrap_or_else(|| end.saturating_sub(10*rra.resolution)); Ok(rra.extract_data(start, end, self.source.last_update)) } None => bail!("unable to find RRA suitable ({:?}:{})", cf, resolution),