summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-03-06 19:15:19 +0100
committerByron Jones <bjones@mozilla.com>2014-03-06 19:15:19 +0100
commita36d1bc13c25446a7639e3710d51f1e6b2e6dd21 (patch)
treeccdeebcbc7bef1a9211f6d2a0124771b8d919d65
parent8bd1b7e6603b41f4c8227c309596eb674df8babd (diff)
downloadbugzilla-a36d1bc13c25446a7639e3710d51f1e6b2e6dd21.tar.gz
bugzilla-a36d1bc13c25446a7639e3710d51f1e6b2e6dd21.tar.xz
Bug 980388: metrics.pl is being called even when metrics_enabled is false
-rw-r--r--Bugzilla.pm8
-rw-r--r--Bugzilla/Install/Filesystem.pm4
-rw-r--r--Bugzilla/Metrics/Collector.pm5
3 files changed, 14 insertions, 3 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 233cc4323..52a44e375 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -697,8 +697,14 @@ sub process_cache {
sub metrics_enabled {
if (defined $_[1]) {
+ if (!$_[1]
+ && $_[0]->request_cache->{metrics_enabled}
+ && $_[0]->request_cache->{metrics})
+ {
+ $_[0]->request_cache->{metrics}->cancel();
+ delete $_[0]->request_cache->{metrics};
+ }
$_[0]->request_cache->{metrics_enabled} = $_[1];
- delete $_[0]->request_cache->{metrics} unless $_[1];
}
else {
return $_[0]->request_cache->{metrics_enabled};
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index c8a951deb..cd1e76916 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -159,8 +159,8 @@ sub FILESYSTEM {
'runtests.pl' => { perms => OWNER_EXECUTE },
'jobqueue.pl' => { perms => OWNER_EXECUTE },
'migrate.pl' => { perms => OWNER_EXECUTE },
- 'sentry.pl' => { perms => OWNER_EXECUTE },
- 'metrics.pl' => { perms => OWNER_EXECUTE },
+ 'sentry.pl' => { perms => WS_EXECUTE },
+ 'metrics.pl' => { perms => WS_EXECUTE },
'install-module.pl' => { perms => OWNER_EXECUTE },
'Bugzilla.pm' => { perms => CGI_READ },
diff --git a/Bugzilla/Metrics/Collector.pm b/Bugzilla/Metrics/Collector.pm
index 7b2fc3f1b..2f9b6130d 100644
--- a/Bugzilla/Metrics/Collector.pm
+++ b/Bugzilla/Metrics/Collector.pm
@@ -42,6 +42,11 @@ sub end {
$self->{head} = $self->{head}->{parent} if $is_head;
}
+sub cancel {
+ my ($self) = @_;
+ delete $self->{head};
+}
+
sub DESTROY {
my ($self) = @_;
$self->finish() if $self->{head};