use Cache.hash instead of Cache.sanitize
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Cache
|
||||
def self.get_multi(keys, prefix)
|
||||
sanitized_key_to_key_hash = keys.map do |key|
|
||||
["#{prefix}:#{Cache.sanitize(key)}", key]
|
||||
["#{prefix}:#{Cache.hash(key)}", key]
|
||||
end.to_h
|
||||
|
||||
sanitized_keys = sanitized_key_to_key_hash.keys
|
||||
|
||||
@@ -14,8 +14,8 @@ class TagAliasCorrection
|
||||
|
||||
def statistics_hash
|
||||
@statistics_hash ||= {
|
||||
"antecedent_cache" => Cache.get("ta:" + Cache.sanitize(tag_alias.antecedent_name)),
|
||||
"consequent_cache" => Cache.get("ta:" + Cache.sanitize(tag_alias.consequent_name)),
|
||||
"antecedent_cache" => Cache.get("ta:" + Cache.hash(tag_alias.antecedent_name)),
|
||||
"consequent_cache" => Cache.get("ta:" + Cache.hash(tag_alias.consequent_name)),
|
||||
"antecedent_count" => Tag.find_by_name(tag_alias.antecedent_name).try(:post_count),
|
||||
"consequent_count" => Tag.find_by_name(tag_alias.consequent_name).try(:post_count)
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ class TagCorrection
|
||||
|
||||
def statistics_hash
|
||||
@statistics_hash ||= {
|
||||
"category_cache" => Cache.get("tc:" + Cache.sanitize(tag.name)),
|
||||
"post_fast_count_cache" => Cache.get("pfc:" + Cache.sanitize(tag.name))
|
||||
"category_cache" => Cache.get("tc:" + Cache.hash(tag.name)),
|
||||
"post_fast_count_cache" => Cache.get("pfc:" + Cache.hash(tag.name))
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user