mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 04:59:35 -07:00
Move DB migration to start
This commit is contained in:
parent
9adc168b90
commit
30a3348ba8
2 changed files with 8 additions and 4 deletions
|
@ -1,8 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.ServiceProcess;
|
using System.ServiceProcess;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using NzbDrone.Common.Composition;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
using NzbDrone.Core.Datastore;
|
||||||
using NzbDrone.Core.Lifecycle;
|
using NzbDrone.Core.Lifecycle;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Host.Owin;
|
using NzbDrone.Host.Owin;
|
||||||
|
@ -22,6 +24,7 @@ namespace NzbDrone.Host
|
||||||
private readonly IHostController _hostController;
|
private readonly IHostController _hostController;
|
||||||
private readonly IStartupContext _startupContext;
|
private readonly IStartupContext _startupContext;
|
||||||
private readonly IBrowserService _browserService;
|
private readonly IBrowserService _browserService;
|
||||||
|
private readonly IContainer _container;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public NzbDroneServiceFactory(IConfigFileProvider configFileProvider,
|
public NzbDroneServiceFactory(IConfigFileProvider configFileProvider,
|
||||||
|
@ -29,6 +32,7 @@ namespace NzbDrone.Host
|
||||||
IRuntimeInfo runtimeInfo,
|
IRuntimeInfo runtimeInfo,
|
||||||
IStartupContext startupContext,
|
IStartupContext startupContext,
|
||||||
IBrowserService browserService,
|
IBrowserService browserService,
|
||||||
|
IContainer container,
|
||||||
Logger logger)
|
Logger logger)
|
||||||
{
|
{
|
||||||
_configFileProvider = configFileProvider;
|
_configFileProvider = configFileProvider;
|
||||||
|
@ -36,6 +40,7 @@ namespace NzbDrone.Host
|
||||||
_runtimeInfo = runtimeInfo;
|
_runtimeInfo = runtimeInfo;
|
||||||
_startupContext = startupContext;
|
_startupContext = startupContext;
|
||||||
_browserService = browserService;
|
_browserService = browserService;
|
||||||
|
_container = container;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,6 +57,7 @@ namespace NzbDrone.Host
|
||||||
}
|
}
|
||||||
|
|
||||||
_runtimeInfo.IsExiting = false;
|
_runtimeInfo.IsExiting = false;
|
||||||
|
DbFactory.RegisterDatabase(_container);
|
||||||
_hostController.StartServer();
|
_hostController.StartServer();
|
||||||
|
|
||||||
if (!_startupContext.Flags.Contains(StartupContext.NO_BROWSER)
|
if (!_startupContext.Flags.Contains(StartupContext.NO_BROWSER)
|
||||||
|
@ -93,4 +99,4 @@ namespace NzbDrone.Host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ using NzbDrone.Common.Instrumentation;
|
||||||
using NzbDrone.Common.Processes;
|
using NzbDrone.Common.Processes;
|
||||||
using NzbDrone.Common.Security;
|
using NzbDrone.Common.Security;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Datastore;
|
|
||||||
using NzbDrone.Core.Instrumentation;
|
using NzbDrone.Core.Instrumentation;
|
||||||
|
|
||||||
namespace NzbDrone.Host
|
namespace NzbDrone.Host
|
||||||
|
@ -76,7 +75,6 @@ namespace NzbDrone.Host
|
||||||
EnsureSingleInstance(applicationModes == ApplicationModes.Service, startupContext);
|
EnsureSingleInstance(applicationModes == ApplicationModes.Service, startupContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
DbFactory.RegisterDatabase(_container);
|
|
||||||
_container.Resolve<Router>().Route(applicationModes);
|
_container.Resolve<Router>().Route(applicationModes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue