mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 01:57:21 +00:00
Fixed MVC profiler issue with Jobs, SQL profiling is on again.
This commit is contained in:
parent
b00e437e56
commit
bbf27c6f66
3 changed files with 18 additions and 16 deletions
|
@ -68,7 +68,8 @@ public static void BindKernel()
|
||||||
_kernel = new StandardKernel();
|
_kernel = new StandardKernel();
|
||||||
|
|
||||||
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString)).InRequestScope();
|
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString)).InRequestScope();
|
||||||
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString, false)).WhenInjectedInto<IJob>().InSingletonScope();
|
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString, false)).WhenInjectedInto<IJob>();
|
||||||
|
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.MainConnectionString, false)).WhenInjectedInto<JobProvider>();
|
||||||
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString, false)).WhenInjectedInto<SubsonicTarget>().InSingletonScope();
|
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString, false)).WhenInjectedInto<SubsonicTarget>().InSingletonScope();
|
||||||
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString)).WhenInjectedInto<LogProvider>().InRequestScope();
|
_kernel.Bind<IDatabase>().ToMethod(c => Connection.GetPetaPocoDb(Connection.LogConnectionString)).WhenInjectedInto<LogProvider>().InRequestScope();
|
||||||
}
|
}
|
||||||
|
@ -76,10 +77,10 @@ public static void BindKernel()
|
||||||
|
|
||||||
private static void BindIndexers()
|
private static void BindIndexers()
|
||||||
{
|
{
|
||||||
_kernel.Bind<IndexerBase>().To<NzbsOrg>().InTransientScope();
|
_kernel.Bind<IndexerBase>().To<NzbsOrg>();
|
||||||
_kernel.Bind<IndexerBase>().To<NzbMatrix>().InTransientScope();
|
_kernel.Bind<IndexerBase>().To<NzbMatrix>();
|
||||||
_kernel.Bind<IndexerBase>().To<NzbsRUs>().InTransientScope();
|
_kernel.Bind<IndexerBase>().To<NzbsRUs>();
|
||||||
_kernel.Bind<IndexerBase>().To<Newzbin>().InTransientScope();
|
_kernel.Bind<IndexerBase>().To<Newzbin>();
|
||||||
|
|
||||||
var indexers = _kernel.GetAll<IndexerBase>();
|
var indexers = _kernel.GetAll<IndexerBase>();
|
||||||
_kernel.Get<IndexerProvider>().InitializeIndexers(indexers.ToList());
|
_kernel.Get<IndexerProvider>().InitializeIndexers(indexers.ToList());
|
||||||
|
@ -87,15 +88,15 @@ private static void BindIndexers()
|
||||||
|
|
||||||
private static void BindJobs()
|
private static void BindJobs()
|
||||||
{
|
{
|
||||||
_kernel.Bind<IJob>().To<RssSyncJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<RssSyncJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<ImportNewSeriesJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<ImportNewSeriesJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<UpdateInfoJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<UpdateInfoJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<DiskScanJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<DiskScanJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<DeleteSeriesJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<DeleteSeriesJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<EpisodeSearchJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<EpisodeSearchJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<RenameEpisodeJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<RenameEpisodeJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<PostDownloadScanJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<PostDownloadScanJob>().InSingletonScope();
|
||||||
_kernel.Bind<IJob>().To<UpdateSceneMappingsJob>().InTransientScope();
|
_kernel.Bind<IJob>().To<UpdateSceneMappingsJob>().InSingletonScope();
|
||||||
|
|
||||||
_kernel.Get<JobProvider>().Initialize();
|
_kernel.Get<JobProvider>().Initialize();
|
||||||
_kernel.Get<WebTimer>().StartTimer(30);
|
_kernel.Get<WebTimer>().StartTimer(30);
|
||||||
|
|
|
@ -47,7 +47,7 @@ public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled
|
||||||
DbConnection connection = new SQLiteConnection(connectionString);
|
DbConnection connection = new SQLiteConnection(connectionString);
|
||||||
if (profiled)
|
if (profiled)
|
||||||
{
|
{
|
||||||
//connection = ProfiledDbConnection.Get(connection);
|
connection = ProfiledDbConnection.Get(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
var db = new Database(connection);
|
var db = new Database(connection);
|
||||||
|
|
|
@ -41,7 +41,8 @@ protected override void OnApplicationStarted()
|
||||||
//base.OnApplicationStarted();
|
//base.OnApplicationStarted();
|
||||||
AreaRegistration.RegisterAllAreas();
|
AreaRegistration.RegisterAllAreas();
|
||||||
RegisterGlobalFilters(GlobalFilters.Filters);
|
RegisterGlobalFilters(GlobalFilters.Filters);
|
||||||
//RegisterRoutes(RouteTable.Routes);
|
|
||||||
|
Logger.Debug("Fully initialized and ready.");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IKernel CreateKernel()
|
protected override IKernel CreateKernel()
|
||||||
|
|
Loading…
Reference in a new issue