Module: Redcord::Migration::TTL
Overview
typed: strict
Instance Method Summary collapse
Instance Method Details
#_get_ttl(model) ⇒ Object
6 7 8 |
# File 'lib/redcord/migration/ttl.rb', line 6 def _get_ttl(model) model.class_variable_get(:@@ttl) || -1 end |
#change_ttl_active(model) ⇒ Object
11 12 13 14 15 |
# File 'lib/redcord/migration/ttl.rb', line 11 def change_ttl_active(model) model.redis.scan_each_shard("#{model.model_key}:id:*") do |key| model.redis.expire(key, _get_ttl(model)) end end |