From 9fb55030496ec4afb5bff88efbc3ff5803ce8431 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 24 Nov 2022 21:19:24 -0600 Subject: vacuum after scanning --- src/slskd/Shares/IShareRepository.cs | 5 +++++ src/slskd/Shares/ShareScanner.cs | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/slskd/Shares/IShareRepository.cs b/src/slskd/Shares/IShareRepository.cs index 63d19c45..f1e59889 100644 --- a/src/slskd/Shares/IShareRepository.cs +++ b/src/slskd/Shares/IShareRepository.cs @@ -181,5 +181,10 @@ namespace slskd.Shares /// The timestamp associated with the scan. /// The timestamp at the conclusion of the scan. void UpdateScan(long timestamp, long end); + + /// + /// Reclaims unused space. + /// + void Vacuum(); } } \ No newline at end of file diff --git a/src/slskd/Shares/ShareScanner.cs b/src/slskd/Shares/ShareScanner.cs index 1648c850..f5bbcd41 100644 --- a/src/slskd/Shares/ShareScanner.cs +++ b/src/slskd/Shares/ShareScanner.cs @@ -319,6 +319,10 @@ namespace slskd.Shares Log.Information("Rebuilding filename index..."); repository.RebuildFilenameIndex(); Log.Information("Filename index rebuild complete"); + + Log.Debug("Vacuuming..."); + repository.Vacuum(); + Log.Debug("Vacuumed successfully"); } catch (OperationCanceledException) { -- cgit v1.2.3