Sha256: e95afefb55ee6de50cf86ae731c8c1d40e7c6e6be72233c90eca50f76a4abfad
Contents?: true
Size: 460 Bytes
Versions: 16
Compression:
Stored size: 460 Bytes
Contents
require 'json' module Schemas module RedisStore EXPIRE = 3.days def redis_retrieve r = Redis.current.get(key) r ? JSON.parse(r) : [] end def redis_store!(schema_rows) Redis.current.del(key) Redis.current.set(key, JSON.generate(schema_rows)) # should be deleting the key before we store # but set expire just in case we switch keys in the code Redis.current.expire(key, EXPIRE) end end end
Version data entries
16 entries across 16 versions & 1 rubygems