diff options
author | Rémy Coutable <remy@rymai.me> | 2019-07-03 16:02:03 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-07-03 16:02:42 +0200 |
commit | eaf58debac14474dc7ad5e5a6a6fc88da0af1370 (patch) | |
tree | 59994faed770c982850822d38131bed11fc6e7b6 /lib | |
parent | 96efba34d32bcde33dbd21e9ef0f181330ddbe96 (diff) | |
download | gitlab-ce-eaf58debac14474dc7ad5e5a6a6fc88da0af1370.tar.gz |
Only save Peek session in Redis when Peek is enabled
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb b/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb new file mode 100644 index 00000000000..2d997760c46 --- /dev/null +++ b/lib/gitlab/performance_bar/redis_adapter_when_peek_enabled.rb @@ -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 |