mirror of https://github.com/Sonarr/Sonarr
Add db name to Vacuum log message.
This commit is contained in:
parent
bb48491eb2
commit
4ca8178ca8
|
@ -14,12 +14,14 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
public class Database : IDatabase
|
||||
{
|
||||
private readonly string _databaseName;
|
||||
private readonly Func<IDataMapper> _datamapperFactory;
|
||||
|
||||
private readonly Logger _logger = NzbDroneLogger.GetLogger(typeof(Database));
|
||||
|
||||
public Database(Func<IDataMapper> datamapperFactory)
|
||||
public Database(string databaseName, Func<IDataMapper> datamapperFactory)
|
||||
{
|
||||
_databaseName = databaseName;
|
||||
_datamapperFactory = datamapperFactory;
|
||||
}
|
||||
|
||||
|
@ -42,9 +44,9 @@ namespace NzbDrone.Core.Datastore
|
|||
{
|
||||
try
|
||||
{
|
||||
_logger.Info("Vacuuming database");
|
||||
_logger.Info("Vacuuming {0} database", _databaseName);
|
||||
_datamapperFactory().ExecuteNonQuery("Vacuum;");
|
||||
_logger.Info("Database Compressed");
|
||||
_logger.Info("{0} database compressed", _databaseName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace NzbDrone.Core.Datastore
|
|||
|
||||
_migrationController.MigrateToLatest(connectionString, migrationType, beforeMigration);
|
||||
|
||||
var db = new Database(() =>
|
||||
var db = new Database(migrationType.ToString(), () =>
|
||||
{
|
||||
var dataMapper = new DataMapper(SQLiteFactory.Instance, connectionString)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue