Sha256: b6c91ac9d5d17c4abc72355d56bacffaa499dafa0e1e779760c96089b86dbc0a
Contents?: true
Size: 570 Bytes
Versions: 62
Compression:
Stored size: 570 Bytes
Contents
# from Geocoder GitHub Repository # # This class implements a cache with simple delegation to the Redis store, but # when it creates a key/value pair, it also sends an EXPIRE command with a TTL. # module Workarea class AutoexpireCacheRedis def initialize(store, ttl = 259200) # "time to live" of 3 days @store = store @ttl = ttl end def [](url) @store.get(url) end def []=(url, value) @store.setex(url, @ttl, value) end def keys @store.keys end def del(url) @store.del(url) end end end
Version data entries
62 entries across 62 versions & 1 rubygems