aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Startup.Common
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-03 15:52:45 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-02-03 15:55:00 -0500
commitfb2a320416d2b7437a483f6f5ecc42e6f67ff91c (patch)
tree19aeda1815891b2df1b79453b6892883cd37ccc4 /MediaBrowser.Server.Startup.Common
parent4fc3753f6498351589daa9101bfe98148a57ce42 (diff)
update upgrade process
Diffstat (limited to 'MediaBrowser.Server.Startup.Common')
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs5
-rw-r--r--MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs3
2 files changed, 7 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index f75aeebdd..7f79653af 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -317,6 +317,11 @@ namespace MediaBrowser.Server.Startup.Common
/// <returns>Task.</returns>
public override async Task RunStartupTasks()
{
+ if (ServerConfigurationManager.Configuration.MigrationVersion < CleanDatabaseScheduledTask.MigrationVersion)
+ {
+ TaskManager.SuspendTriggers = true;
+ }
+
await base.RunStartupTasks().ConfigureAwait(false);
Logger.Info("ServerId: {0}", SystemId);
diff --git a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
index 1df49845b..959543893 100644
--- a/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
+++ b/MediaBrowser.Server.Startup.Common/Migrations/DbMigration.cs
@@ -20,13 +20,14 @@ namespace MediaBrowser.Server.Startup.Common.Migrations
{
if (_config.Configuration.MigrationVersion < CleanDatabaseScheduledTask.MigrationVersion)
{
+ _taskManager.SuspendTriggers = true;
CleanDatabaseScheduledTask.EnableUnavailableMessage = true;
Task.Run(async () =>
{
await Task.Delay(1000).ConfigureAwait(false);
- _taskManager.QueueScheduledTask<CleanDatabaseScheduledTask>();
+ _taskManager.Execute<CleanDatabaseScheduledTask>();
});
}
}