From 0e9aa78bf4979720eec58352ac7afa6b0b4a8db2 Mon Sep 17 00:00:00 2001 From: Gabriel Goller Date: Wed, 3 Jul 2024 17:02:46 +0200 Subject: [PATCH] datastore: avoid calculating protected attribute twice The protected status of the snapshot is retrieved twice. This is slow because it stat's the .protected file multiple times. Signed-off-by: Gabriel Goller Tested-by: Christian Ebner Reviewed-by: Christian Ebner --- src/api2/admin/datastore.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 8342078a1..09518c64e 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -505,7 +505,7 @@ unsafe fn list_snapshots_blocking( group: group.into(), time: info.backup_dir.backup_time(), }; - let protected = info.backup_dir.is_protected(); + let protected = info.protected; match get_all_snapshot_files(&info) { Ok((manifest, files)) => {