Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-26 16:57:59 +0300
committerSean McGivern <sean@gitlab.com>2019-08-27 16:15:25 +0300
commit7f102819a56b55607e657447b51d2eeb45b2fe94 (patch)
treecd0cbf4d2c45d7beabc2663c00d1b00f5fc83cdc /app/controllers
parent7671c592f826f44be5a8a7dc947fba467f5df851 (diff)
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/controllers')
-rw-r--r--app/controllers/concerns/with_performance_bar.rb6
1 files changed, 6 insertions, 0 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)