diff --git a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs index b48e953e0..9199fea9d 100644 --- a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs +++ b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using NLog; +using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Lifecycle; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Events; @@ -14,7 +15,7 @@ public class HousekeepingService : IExecute, IHandleAsync housekeepers, Logger logger, IDatabase mainDb) + public HousekeepingService(IEnumerable housekeepers, IDatabase mainDb, Logger logger) { _housekeepers = housekeepers; _logger = logger; @@ -37,9 +38,13 @@ private void Clean() } } - // Vacuuming the log db isn't needed since that's done hourly at the TrimLogCommand. - _logger.Debug("Compressing main database after housekeeping"); - _mainDb.Vacuum(); + //Only Vaccuum the DB in production + if (RuntimeInfo.IsProduction) + { + // Vacuuming the log db isn't needed since that's done hourly at the TrimLogCommand. + _logger.Debug("Compressing main database after housekeeping"); + _mainDb.Vacuum(); + } } public void Execute(HousekeepingCommand message)