summaryrefslogtreecommitdiff
path: root/lib/repository_cache.rb
diff options
context:
space:
mode:
authorMarcia Ramos <virtua.creative@gmail.com>2018-03-09 12:36:26 -0300
committerMarcia Ramos <virtua.creative@gmail.com>2018-03-09 12:36:26 -0300
commit5596933b535d632cf3c8159889a72b1e98e4ec0a (patch)
tree5edc39c0408a1e5bcbc13168dedbdabd1eba417f /lib/repository_cache.rb
parentda5694c5cbaf62d5568339efd1a6f340f97e6e53 (diff)
parent3bbe60f8e802ce3d9da060a47b7f635dedba7370 (diff)
downloadgitlab-ce-docs-refactor-dev-guides.tar.gz
Diffstat (limited to 'lib/repository_cache.rb')
-rw-r--r--lib/repository_cache.rb30
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/repository_cache.rb b/lib/repository_cache.rb
deleted file mode 100644
index 068a95790c0..00000000000
--- a/lib/repository_cache.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# Interface to the Redis-backed cache store used by the Repository model
-class RepositoryCache
- attr_reader :namespace, :backend, :project_id
-
- def initialize(namespace, project_id, backend = Rails.cache)
- @namespace = namespace
- @backend = backend
- @project_id = project_id
- end
-
- def cache_key(type)
- "#{type}:#{namespace}:#{project_id}"
- end
-
- def expire(key)
- backend.delete(cache_key(key))
- end
-
- def fetch(key, &block)
- backend.fetch(cache_key(key), &block)
- end
-
- def exist?(key)
- backend.exist?(cache_key(key))
- end
-
- def read(key)
- backend.read(cache_key(key))
- end
-end