From: Dylan Hardison Date: Sun, 17 May 2020 00:22:32 +0000 (-0400) Subject: no bug - clear request cache in Glue plugin, before setting usage mode X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e9c7fbb366dd3e693735b6b6e61c1c86b73b9c7;p=thirdparty%2Fbugzilla.git no bug - clear request cache in Glue plugin, before setting usage mode --- diff --git a/Bugzilla/App.pm b/Bugzilla/App.pm index 1e3e34108..a5fc85fb3 100644 --- a/Bugzilla/App.pm +++ b/Bugzilla/App.pm @@ -131,16 +131,6 @@ sub startup { } ); } - $self->hook( - before_dispatch => sub { - # Ensure the request_cache is always cleared prior to every request, - # regardless of routing or Bugzilla::App wrapping. - # This is not an expensive operation. - Bugzilla->clear_request_cache(); - # We also need to clear CGI's globals. - CGI::initialize_globals(); - } - ); $self->hook(after_dispatch => sub { my ($c) = @_; my ($req, $res) = ($c->req, $c->res); diff --git a/Bugzilla/App/Plugin/Glue.pm b/Bugzilla/App/Plugin/Glue.pm index dbaee4b43..4b56629a6 100644 --- a/Bugzilla/App/Plugin/Glue.pm +++ b/Bugzilla/App/Plugin/Glue.pm @@ -40,6 +40,13 @@ sub register { my ($c) = @_; Log::Log4perl::MDC->put(request_id => $c->req->request_id); $c->stash->{cleanup_guard} = Scope::Guard->new(\&Bugzilla::cleanup); + + # Ensure the request_cache is always cleared prior to every request, + # regardless of routing or Bugzilla::App wrapping. + # This is not an expensive operation. + Bugzilla->clear_request_cache(); + # We also need to clear CGI's globals. + CGI::initialize_globals(); Bugzilla->usage_mode(USAGE_MODE_MOJO); } );