Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-07-25 16:16:19 +0300
committerRémy Coutable <remy@rymai.me>2016-07-27 14:11:38 +0300
commit1fed50822051bd49e7a3438645d5db2d9d53b9be (patch)
tree95ffe7e4ef7289d72551d320eac0557a352d8b88 /lib
parent54b71febb29908f9d9077847036aebb64a727e82 (diff)
Merge branch 'use-project-id-in-repo-cache' into 'master'
Use project ID in repository cache to prevent stale data from persisting across projects See merge request !5460 Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib')
-rw-r--r--lib/repository_cache.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/repository_cache.rb b/lib/repository_cache.rb
index 8ddc3511293..068a95790c0 100644
--- a/lib/repository_cache.rb
+++ b/lib/repository_cache.rb
@@ -1,14 +1,15 @@
# Interface to the Redis-backed cache store used by the Repository model
class RepositoryCache
- attr_reader :namespace, :backend
+ attr_reader :namespace, :backend, :project_id
- def initialize(namespace, backend = Rails.cache)
+ def initialize(namespace, project_id, backend = Rails.cache)
@namespace = namespace
@backend = backend
+ @project_id = project_id
end
def cache_key(type)
- "#{type}:#{namespace}"
+ "#{type}:#{namespace}:#{project_id}"
end
def expire(key)