Only save Peek session in Redis when Peek is enabled
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
96efba34d3
commit
eaf58debac
2 changed files with 15 additions and 0 deletions
|
@ -42,3 +42,6 @@ class PEEK_DB_CLIENT
|
|||
end
|
||||
|
||||
PEEK_DB_VIEW.prepend ::Gitlab::PerformanceBar::PeekQueryTracker
|
||||
|
||||
require 'peek/adapters/redis'
|
||||
Peek::Adapters::Redis.prepend ::Gitlab::PerformanceBar::RedisAdapterWhenPeekEnabled
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
# 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
|
Loading…
Reference in a new issue