From becd8e2dac7994e196228aaea352ca6a124111d2 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Wed, 7 Dec 2011 20:02:58 -0800 Subject: [PATCH] Miniprofiler is only enabled in production. --- NzbDrone.Web/App_Start/MiniProfiler.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Web/App_Start/MiniProfiler.cs b/NzbDrone.Web/App_Start/MiniProfiler.cs index 4639ee3a1..a0694dab8 100644 --- a/NzbDrone.Web/App_Start/MiniProfiler.cs +++ b/NzbDrone.Web/App_Start/MiniProfiler.cs @@ -4,6 +4,8 @@ using System.Linq; using MvcMiniProfiler; using MvcMiniProfiler.MVCHelpers; using Microsoft.Web.Infrastructure.DynamicModuleHelper; +using NzbDrone.Common; + //using System.Data; //using System.Data.Entity; //using System.Data.Entity.Infrastructure; @@ -66,7 +68,11 @@ namespace NzbDrone.Web.App_Start //TODO: By default only local requests are profiled, optionally you can set it up // so authenticated users are always profiled //if (request.IsLocal) { MiniProfiler.Start(); } - MiniProfiler.Start(); + + if (!EnviromentProvider.IsProduction) + { + MiniProfiler.Start(); + } }; @@ -81,10 +87,7 @@ namespace NzbDrone.Web.App_Start }; */ - context.EndRequest += (sender, e) => - { - MiniProfiler.Stop(); - }; + context.EndRequest += (sender, e) => MiniProfiler.Stop(); } public void Dispose() { }