Commit 80bb04eb authored by Sean McGivern's avatar Sean McGivern

Merge branch 'do-not-save-peek-request-for-unauthenticated-users' into 'master'

Only save Peek session in Redis when Peek is enabled

See merge request gitlab-org/gitlab-ce!30306
parents 406b67ca eaf58deb
...@@ -42,3 +42,6 @@ class PEEK_DB_CLIENT ...@@ -42,3 +42,6 @@ class PEEK_DB_CLIENT
end end
PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker
require 'peek/adapters/redis'
Peek::Adapters::Redis.prepend ::Gitlab::PerformanceBar::RedisAdapterWhenPeekEnabled
# frozen_string_literal: true
# Adapted from https://github.com/peek/peek/blob/master/lib/peek/adapters/redis.rb
module Gitlab
module PerformanceBar
module RedisAdapterWhenPeekEnabled
def save
super unless ::Peek.request_id.blank?
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment