Use Redis namespaces for caching stuff.

pull/1236/head
Rick Carlino 2019-06-14 14:23:25 -05:00
parent 48dd82be6f
commit fe74c4648b
2 changed files with 3 additions and 3 deletions

View File

@ -1,12 +1,12 @@
# Support class for Fragment. Please see fragment.rb for documentation.
class ArgName < ApplicationRecord
EXPIRY = Rails.env.test? ? 1.second : 2.hours
KEY = "arg_names/%s"
KEY = "arg_names:%s"
validates_uniqueness_of :value
has_many :primitive_pairs, autosave: true
has_many :standard_pairs, autosave: true
has_many :standard_pairs, autosave: true
def self.cached_by_value(v)
key = KEY % v

View File

@ -1,7 +1,7 @@
# Support class for Fragment. Please see fragment.rb for documentation.
class Kind < ApplicationRecord
EXPIRY = Rails.env.test? ? 1.second : 2.hours
KEY = "kinds/%s"
KEY = "kinds:%s"
has_many :nodes
def self.cached_by_value(v)