From 8c4f010b8d7c667b7aef7fe121d4cbc48890a7c6 Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Tue, 15 Mar 2022 08:56:22 -0500 Subject: [PATCH] fix logging: only walk remote dir if it exist (#23663) --- runtime/src/snapshot_utils.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 54121a66cf..608b2c1682 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -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 }