From 20a477f95d2515804c7b78debd85015c4e32c778 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 20 Dec 2022 17:07:11 -0800 Subject: [PATCH] Fixed: Only log /proc/mounts exception once per process Closes #2080 (cherry picked from commit ce0388ca99b7f89bd9e8971777a7995c4361d268) --- src/NzbDrone.Mono/Disk/ProcMountProvider.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Mono/Disk/ProcMountProvider.cs b/src/NzbDrone.Mono/Disk/ProcMountProvider.cs index 3471116a9..76ed7758b 100644 --- a/src/NzbDrone.Mono/Disk/ProcMountProvider.cs +++ b/src/NzbDrone.Mono/Disk/ProcMountProvider.cs @@ -26,6 +26,7 @@ namespace NzbDrone.Mono.Disk private static Dictionary _fileSystems; private readonly Logger _logger; + private bool _hasLoggedProcMountFailure = false; public ProcMountProvider(Logger logger) { @@ -45,7 +46,11 @@ namespace NzbDrone.Mono.Disk } catch (Exception ex) { - _logger.Debug(ex, "Failed to retrieve mounts from {0}", PROC_MOUNTS_FILENAME); + if (!_hasLoggedProcMountFailure) + { + _logger.Debug(ex, "Failed to retrieve mounts from {0}", PROC_MOUNTS_FILENAME); + _hasLoggedProcMountFailure = true; + } } return new List();