mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Add db name to Vacuum log message.
This commit is contained in:
parent
bb48491eb2
commit
4ca8178ca8
@ -14,12 +14,14 @@ public interface IDatabase
|
||||
|
||||
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 @@ public void Vacuum()
|
||||
{
|
||||
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 @@ public IDatabase Create(MigrationType migrationType = MigrationType.Main, Action
|
||||
|
||||
_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
Block a user