diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 12:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-24 12:08:51 +0300 |
commit | 38149afcf95e7669a7a99828c579d185b70c04dc (patch) | |
tree | 3a90504bd926407c0cc60f44e20dba08217b928b /lib/gitlab/repository_set_cache.rb | |
parent | be660fe1d28a65ad61be24c71e66ae90f6488dc4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/repository_set_cache.rb')
-rw-r--r-- | lib/gitlab/repository_set_cache.rb | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/lib/gitlab/repository_set_cache.rb b/lib/gitlab/repository_set_cache.rb index 4797ec0b116..1e2d86b7ad2 100644 --- a/lib/gitlab/repository_set_cache.rb +++ b/lib/gitlab/repository_set_cache.rb @@ -2,7 +2,7 @@ # Interface to the Redis-backed cache store for keys that use a Redis set module Gitlab - class RepositorySetCache + class RepositorySetCache < Gitlab::SetCache attr_reader :repository, :namespace, :expires_in def initialize(repository, extra_namespace: nil, expires_in: 2.weeks) @@ -17,18 +17,6 @@ module Gitlab "#{type}:#{namespace}:set" end - def expire(key) - with { |redis| redis.del(cache_key(key)) } - end - - def exist?(key) - with { |redis| redis.exists(cache_key(key)) } - end - - def read(key) - with { |redis| redis.smembers(cache_key(key)) } - end - def write(key, value) full_key = cache_key(key) @@ -54,15 +42,5 @@ module Gitlab write(key, yield) end end - - def include?(key, value) - with { |redis| redis.sismember(cache_key(key), value) } - end - - private - - def with(&blk) - Gitlab::Redis::Cache.with(&blk) # rubocop:disable CodeReuse/ActiveRecord - end end end |