From f651c0e23d78e871f00966b0b50da49cd704b36c Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 1 Mar 2012 18:36:42 -0800 Subject: [PATCH] Fixed issue where signalr and miniprofiler weren't playing nice with each other. --- NzbDrone.Web/App_Start/MiniProfiler.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Web/App_Start/MiniProfiler.cs b/NzbDrone.Web/App_Start/MiniProfiler.cs index f103e69c6..4dd5a5fa7 100644 --- a/NzbDrone.Web/App_Start/MiniProfiler.cs +++ b/NzbDrone.Web/App_Start/MiniProfiler.cs @@ -17,7 +17,7 @@ using NzbDrone.Web.Helpers; [assembly: WebActivator.PostApplicationStartMethod(typeof(NzbDrone.Web.App_Start.MiniProfilerPackage), "PostStart")] -namespace NzbDrone.Web.App_Start +namespace NzbDrone.Web.App_Start { public static class MiniProfilerPackage { @@ -33,11 +33,11 @@ namespace NzbDrone.Web.App_Start //TODO: Non SQL Server based installs can use other formatters like: new MvcMiniProfiler.SqlFormatters.InlineFormatter() MiniProfiler.Settings.SqlFormatter = new MvcMiniProfiler.SqlFormatters.SqlServerFormatter(); - //TODO: To profile a standard DbConnection: - // var profiled = new ProfiledDbConnection(cnn, MiniProfiler.Current); + //TODO: To profile a standard DbConnection: + // var profiled = new ProfiledDbConnection(cnn, MiniProfiler.Current); //TODO: If you are profiling EF code first try: - // MiniProfilerEF.Initialize(); + // MiniProfilerEF.Initialize(); //Make sure the MiniProfiler handles BeginRequest and EndRequest DynamicModuleUtility.RegisterModule(typeof(MiniProfilerStartupModule)); @@ -72,11 +72,14 @@ namespace NzbDrone.Web.App_Start if (!EnviromentProvider.IsProduction || ProfilerHelper.Enabled()) { - MiniProfiler.Start(); + var requestPath = ((HttpApplication)sender).Request.AppRelativeCurrentExecutionFilePath.ToLower(); + if (!requestPath.StartsWith("~/signalr") && !requestPath.EndsWith("notification/comet")) + { + MiniProfiler.Start(); + } } }; - // TODO: You can control who sees the profiling information /* context.AuthenticateRequest += (sender, e) =>