Commit eaf58deb authored by Rémy Coutable's avatar Rémy Coutable

Only save Peek session in Redis when Peek is enabled

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 96efba34
......@@ -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
# 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