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
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-07-05 13:33:42 +0300
committerRémy Coutable <remy@rymai.me>2018-07-05 13:34:15 +0300
commitf349f2a68c290ef0bfa9c32777426f8be86c0e43 (patch)
tree3d17acefcd1b79b36b912e572f0c202a1a84e669 /app/models/concerns/cacheable_attributes.rb
parentfe695ebd24e59f82d16aba629dd6d117be3ee5bb (diff)
Stop relying on migrations in the CacheableAttributes cache key and cache attributes for 1 minute instead
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/concerns/cacheable_attributes.rb')
-rw-r--r--app/models/concerns/cacheable_attributes.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/cacheable_attributes.rb b/app/models/concerns/cacheable_attributes.rb
index d58d7165969..606549b947f 100644
--- a/app/models/concerns/cacheable_attributes.rb
+++ b/app/models/concerns/cacheable_attributes.rb
@@ -7,7 +7,7 @@ module CacheableAttributes
class_methods do
def cache_key
- "#{name}:#{Gitlab::VERSION}:#{Gitlab.migrations_hash}:#{Rails.version}".freeze
+ "#{name}:#{Gitlab::VERSION}:#{Rails.version}".freeze
end
# Can be overriden
@@ -69,6 +69,6 @@ module CacheableAttributes
end
def cache!
- Rails.cache.write(self.class.cache_key, self)
+ Rails.cache.write(self.class.cache_key, self, expires_in: 1.minute)
end
end