From de7a4c4be62328e7e2de3abbf8712f0118a35459 Mon Sep 17 00:00:00 2001 From: Justin Moore Date: Tue, 8 Aug 2023 09:45:02 -0500 Subject: [PATCH] Tolerate errors when attempting to fetch metadata for `CreateKind::Any` or `CreateKind::Other` --- src/agent/onefuzz/src/monitor.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/agent/onefuzz/src/monitor.rs b/src/agent/onefuzz/src/monitor.rs index 5715b8bdf70..f13bb315a11 100644 --- a/src/agent/onefuzz/src/monitor.rs +++ b/src/agent/onefuzz/src/monitor.rs @@ -136,13 +136,11 @@ impl DirectoryMonitor { return Ok(Some(path)); } - // check if it is a file - let metadata = fs::metadata(&path) - .await - .context("checking metadata for file")?; - - if metadata.is_file() { - return Ok(Some(path)); + if let Ok(metadata) = fs::metadata(&path).await { + // check if it is a file + if metadata.is_file() { + return Ok(Some(path)); + } } } }