Commit 7fec2f2a authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Improve patching of Redis interceptor

Prepend the class in an initializer so that it does not depend on
autoloading
parent 5390d2ab
# frozen_string_literal: true # frozen_string_literal: true
Redis::Client.prepend(Gitlab::Instrumentation::RedisInterceptor)
# Make sure we initialize a Redis connection pool before multi-threaded # Make sure we initialize a Redis connection pool before multi-threaded
# execution starts by # execution starts by
# 1. Sidekiq # 1. Sidekiq
......
# frozen_string_literal: true # frozen_string_literal: true
require 'redis'
module Gitlab module Gitlab
module Instrumentation module Instrumentation
module RedisInterceptor module RedisInterceptor
...@@ -99,7 +97,3 @@ module Gitlab ...@@ -99,7 +97,3 @@ module Gitlab
end end
end end
end end
class ::Redis::Client
prepend ::Gitlab::Instrumentation::RedisInterceptor
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