Sha256: 81a9f505664122dcdbaebcb24df34c019f9f4398d5d3b474a4874c7e3450a1cb
Contents?: true
Size: 494 Bytes
Versions: 12
Compression:
Stored size: 494 Bytes
Contents
require 'routemaster/cache_key' module Routemaster class EventIndex attr_reader :url, :cache def initialize(url, cache: Config.cache_redis) @url = url @cache = cache end def increment i = cache.hincrby(CacheKey.url_key(url), 'current_index', 1).to_i Config.logger.debug("DRAIN: Increment #{@url} to #{i}") if Config.logger.debug? i end def current (cache.hget(CacheKey.url_key(url), 'current_index') || 0).to_i end end end
Version data entries
12 entries across 12 versions & 1 rubygems