fix logging: only walk remote dir if it exist (#23663)

This commit is contained in:
HaoranYi 2022-03-15 08:56:22 -05:00 committed by GitHub
parent 64e2d9dc47
commit 8c4f010b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1166,9 +1166,10 @@ where
};
let mut ret = walk_dir(snapshot_archives_dir);
ret.append(&mut walk_dir(
build_snapshot_archives_remote_dir(snapshot_archives_dir).as_ref(),
));
let remote_dir = build_snapshot_archives_remote_dir(snapshot_archives_dir);
if remote_dir.exists() {
ret.append(&mut walk_dir(remote_dir.as_ref()));
}
ret
}