summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-26 14:57:59 +0100
committerSean McGivern <sean@gitlab.com>2019-08-27 14:15:25 +0100
commit7f102819a56b55607e657447b51d2eeb45b2fe94 (patch)
treecd0cbf4d2c45d7beabc2663c00d1b00f5fc83cdc /app
parent7671c592f826f44be5a8a7dc947fba467f5df851 (diff)
downloadgitlab-ce-7f102819a56b55607e657447b51d2eeb45b2fe94.tar.gz
Fix Peek on Puma
Peek's `Peek.request_id` method doesn't work well with a multi-threaded server and concurrent requests, because requests can 'steal' another request's ID, or unset it before it was due. The upstream change resolves this; the commit here is just to ensure that GitLab works with that upstream change, mostly by not using `Peek.request_id` any more (as the method doesn't exist).
Diffstat (limited to 'app')
-rw-r--r--app/controllers/concerns/with_performance_bar.rb6
-rw-r--r--app/views/peek/_bar.html.haml2
2 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/concerns/with_performance_bar.rb b/app/controllers/concerns/with_performance_bar.rb
index 4e0ae3c59eb..b19d6eb9439 100644
--- a/app/controllers/concerns/with_performance_bar.rb
+++ b/app/controllers/concerns/with_performance_bar.rb
@@ -3,6 +3,12 @@
module WithPerformanceBar
extend ActiveSupport::Concern
+ included do
+ before_action :peek_enabled? # Warm cache
+ end
+
+ protected
+
def peek_enabled?
return false unless Gitlab::PerformanceBar.enabled?(current_user)
diff --git a/app/views/peek/_bar.html.haml b/app/views/peek/_bar.html.haml
index 5228930293c..3c2c4d30535 100644
--- a/app/views/peek/_bar.html.haml
+++ b/app/views/peek/_bar.html.haml
@@ -1,6 +1,6 @@
- return unless peek_enabled?
#js-peek{ data: { env: Peek.env,
- request_id: Peek.request_id,
+ request_id: peek_request_id,
peek_url: "#{peek_routes_path}/results" },
class: Peek.env }