lib/fnordmetric/worker.rb in fnordmetric-1.0.1 vs lib/fnordmetric/worker.rb in fnordmetric-1.2.0
- old
+ new
@@ -53,11 +53,11 @@
def stats_key
[@opts[:redis_prefix], 'stats'].join("-")
end
def announce_event(event)
- namespace(event[:_namespace]).ready!(redis).announce(event)
+ namespace(event[:_namespace]).ready!(redis, sync_redis).announce(event)
end
def expire_event(event_id)
redis.expire(event_key(event_id), @opts[:event_data_ttl])
end
@@ -78,8 +78,12 @@
FnordMetric.error "invalid json: #{e.to_s}"; false
end
def redis
@redis ||= EM::Hiredis.connect(FnordMetric.options[:redis_url]) # FIXPAUL
+ end
+
+ def sync_redis
+ @sync_redis ||= FnordMetric.mk_redis
end
end