Fixed MVC profiler issue with Jobs, SQL profiling is on again.

pull/4/head
kay.one 14 years ago
parent b00e437e56
commit bbf27c6f66

@ -68,7 +68,8 @@ namespace NzbDrone.Core
_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 @@ namespace NzbDrone.Core
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 @@ namespace NzbDrone.Core
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 @@ namespace NzbDrone.Core.Datastore
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 @@ namespace NzbDrone.Web
//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…
Cancel
Save