mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Only vacuum the DB in production
This commit is contained in:
parent
1d4837a5f2
commit
0a1db9d071
@ -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<HousekeepingCommand>, IHandleAsync<A
|
||||
private readonly Logger _logger;
|
||||
private readonly IDatabase _mainDb;
|
||||
|
||||
public HousekeepingService(IEnumerable<IHousekeepingTask> housekeepers, Logger logger, IDatabase mainDb)
|
||||
public HousekeepingService(IEnumerable<IHousekeepingTask> housekeepers, IDatabase mainDb, Logger logger)
|
||||
{
|
||||
_housekeepers = housekeepers;
|
||||
_logger = logger;
|
||||
@ -37,10 +38,14 @@ private void Clean()
|
||||
}
|
||||
}
|
||||
|
||||
//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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user