From 3b63d1b7e5ad1e2adcbac550616d06a2316f6dd2 Mon Sep 17 00:00:00 2001 From: Flaminel Date: Tue, 25 Mar 2025 10:55:37 +0200 Subject: [PATCH] fixed some logs and comments --- .../Verticals/Files/UnixHardLinkFileService.cs | 2 +- .../Verticals/Files/WindowsHardLinkFileService.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs b/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs index ebe6920..7720b64 100644 --- a/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs +++ b/code/Infrastructure/Verticals/Files/UnixHardLinkFileService.cs @@ -31,7 +31,7 @@ public class UnixHardLinkFileService : IHardLinkFileService, IDisposable return (long)stat.st_nlink == 1 ? 0 : 1; } - // subtract the number of hardlinks in the same root directory + // get the number of hardlinks in the same root directory int linksInIgnoredDir = _inodeCounts.TryGetValue(stat.st_ino, out int count) ? count : 1; // default to 1 if not found diff --git a/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs b/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs index 70dd1ff..fde441d 100644 --- a/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs +++ b/code/Infrastructure/Verticals/Files/WindowsHardLinkFileService.cs @@ -37,12 +37,12 @@ public class WindowsHardLinkFileService : IHardLinkFileService, IDisposable // Get unique file ID (combination of high and low indices) ulong fileIndex = ((ulong)file.FileIndexHigh << 32) | file.FileIndexLow; - // Adjusted case: Check if there are links outside the ignored directory + // get the number of hardlinks in the same root directory int linksInIgnoredDir = _fileIndexCounts.TryGetValue(fileIndex, out int count) ? count - : 1; // Default to 1 if not found + : 1; // default to 1 if not found - _logger.LogDebug("stat file {file} | links: {links} | ignored: {ignored}", filePath, file.NumberOfLinks, linksInIgnoredDir); + _logger.LogDebug("stat file | hardlinks: {links} | ignored: {ignored} | {file}", file.NumberOfLinks, linksInIgnoredDir, filePath); return file.NumberOfLinks - linksInIgnoredDir; } catch (Exception exception)