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
+2
-1
@@ -797,7 +797,8 @@ pub async fn pull_store(
|
||||
|
||||
if params.remove_vanished {
|
||||
let result: Result<(), Error> = proxmox_lang::try_block!({
|
||||
for local_group in params.store.list_backup_groups()? {
|
||||
for local_group in params.store.iter_backup_groups()? {
|
||||
let local_group = local_group?;
|
||||
if new_groups.contains(&local_group) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user