mirror of
https://github.com/Sonarr/Sonarr
synced 2025-02-26 07:53:36 +00:00
removed migrationcache
This commit is contained in:
parent
abd994ef71
commit
5117eaaf5c
1 changed files with 18 additions and 28 deletions
|
@ -1,5 +1,4 @@
|
||||||
using System.Collections.Generic;
|
using System.Reflection;
|
||||||
using System.Reflection;
|
|
||||||
using FluentMigrator.Runner;
|
using FluentMigrator.Runner;
|
||||||
using FluentMigrator.Runner.Initialization;
|
using FluentMigrator.Runner.Initialization;
|
||||||
using FluentMigrator.Runner.Processors.Sqlite;
|
using FluentMigrator.Runner.Processors.Sqlite;
|
||||||
|
@ -17,8 +16,6 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
|
||||||
private readonly ISQLiteAlter _sqLiteAlter;
|
private readonly ISQLiteAlter _sqLiteAlter;
|
||||||
private readonly ISqLiteMigrationHelper _migrationHelper;
|
private readonly ISqLiteMigrationHelper _migrationHelper;
|
||||||
|
|
||||||
private static readonly HashSet<string> MigrationCache = new HashSet<string>();
|
|
||||||
|
|
||||||
public MigrationController(IAnnouncer announcer, ISQLiteAlter sqLiteAlter, ISqLiteMigrationHelper migrationHelper)
|
public MigrationController(IAnnouncer announcer, ISQLiteAlter sqLiteAlter, ISqLiteMigrationHelper migrationHelper)
|
||||||
{
|
{
|
||||||
_announcer = announcer;
|
_announcer = announcer;
|
||||||
|
@ -28,10 +25,6 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
|
||||||
|
|
||||||
public void MigrateToLatest(string connectionString, MigrationType migrationType)
|
public void MigrateToLatest(string connectionString, MigrationType migrationType)
|
||||||
{
|
{
|
||||||
lock (MigrationCache)
|
|
||||||
{
|
|
||||||
if (MigrationCache.Contains(connectionString.ToLower())) return;
|
|
||||||
|
|
||||||
_announcer.Heading("Migrating " + connectionString);
|
_announcer.Heading("Migrating " + connectionString);
|
||||||
|
|
||||||
var assembly = Assembly.GetExecutingAssembly();
|
var assembly = Assembly.GetExecutingAssembly();
|
||||||
|
@ -52,9 +45,6 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
|
||||||
var processor = factory.Create(connectionString, _announcer, options);
|
var processor = factory.Create(connectionString, _announcer, options);
|
||||||
var runner = new MigrationRunner(assembly, migrationContext, processor);
|
var runner = new MigrationRunner(assembly, migrationContext, processor);
|
||||||
runner.MigrateUp(true);
|
runner.MigrateUp(true);
|
||||||
|
|
||||||
MigrationCache.Add(connectionString.ToLower());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue