summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-03 11:04:20 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-03 11:04:20 +0200
commitc1c89500f39b0bc3a77e016a11a8041e63871c80 (patch)
treebfa92c57c6f17fbf1c19ab38924d99d637ca2ec2 /config
parentb118f648cb393d9ef4e1e510e86b72cb3e8c98f3 (diff)
parent0e994615a0e4fb5c07a5fec03446c503f95c677e (diff)
downloadgitlab-ce-c1c89500f39b0bc3a77e016a11a8041e63871c80.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'config')
-rw-r--r--config/initializers/redis-store-fix-expiry.rb44
1 files changed, 0 insertions, 44 deletions
diff --git a/config/initializers/redis-store-fix-expiry.rb b/config/initializers/redis-store-fix-expiry.rb
deleted file mode 100644
index fce0a135330..00000000000
--- a/config/initializers/redis-store-fix-expiry.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# Monkey-patch Redis::Store to make 'setex' and 'expire' work with namespacing
-
-module Gitlab
- class Redis
- class Store
- module Namespace
- # Redis::Store#setex in redis-store 1.1.4 does not respect namespaces;
- # this new method does.
- def setex(key, expires_in, value, options=nil)
- namespace(key) { |key| super(key, expires_in, value) }
- end
-
- # Redis::Store#expire in redis-store 1.1.4 does not respect namespaces;
- # this new method does.
- def expire(key, expires_in)
- namespace(key) { |key| super(key, expires_in) }
- end
-
- private
-
- # Our new definitions of #setex and #expire above assume that the
- # #namespace method exists. Because we cannot be sure of that, we
- # re-implement the #namespace method from Redis::Store::Namespace so
- # that it is available for all Redis::Store instances, whether they use
- # namespacing or not.
- #
- # Based on lib/redis/store/namespace.rb L49-51 (redis-store 1.1.4)
- def namespace(key)
- if @namespace
- yield interpolate(key)
- else
- # This Redis::Store instance does not use a namespace so we should
- # just pass through the key.
- yield key
- end
- end
- end
- end
- end
-end
-
-Redis::Store.class_eval do
- include Gitlab::Redis::Store::Namespace
-end