]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - clear request cache in Glue plugin, before setting usage mode
authorDylan Hardison <dylan@hardison.net>
Sun, 17 May 2020 00:22:32 +0000 (20:22 -0400)
committerDylan Hardison <dylan@hardison.net>
Sun, 17 May 2020 00:24:36 +0000 (20:24 -0400)
Bugzilla/App.pm
Bugzilla/App/Plugin/Glue.pm

index 1e3e341089c3f06f0c74cca2f06424e140094b95..a5fc85fb36dda0592b0b9229f0a4538d396b49d2 100644 (file)
@@ -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);
index dbaee4b4316356e02089e4da449ae573a52f3531..4b56629a6a0f29d44062eabf3931cbb85669f355 100644 (file)
@@ -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);
     }
   );