backup: switch over to streaming Iterator improving memory usage
Avoid collecting the whole group list in memory only to iterate and filter over it again. Note that the change could result in a indentation change, so best viewed with `-w` flag. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
1 parent
7b125de3e1
commit
249dde8b63
4 files changed
+55
-64
No files matched your search
@@ -537,9 +537,8 @@ pub fn verify_all_backups(
|
||||
}
|
||||
};
|
||||
|
||||
let mut list = match verify_worker.datastore.list_backup_groups() {
|
||||
let mut list = match verify_worker.datastore.iter_backup_groups_ok() {
|
||||
Ok(list) => list
|
||||
.into_iter()
|
||||
.filter(|group| !(group.backup_type() == "host" && group.backup_id() == "benchmark"))
|
||||
.filter(filter_by_owner)
|
||||
.collect::<Vec<BackupGroup>>(),
|
||||
|
||||
Reference in new issue
Block a user