use Cache.hash instead of Cache.sanitize

This commit is contained in:
r888888888
2017-08-24 15:43:38 -07:00
parent 18f617e08a
commit b769b83262
6 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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