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:
@ -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