lib/pigato/worker.rb in pigato-0.4.7 vs lib/pigato/worker.rb in pigato-0.4.8

- old
+ new

@@ -14,11 +14,11 @@ :reconnect => 2500 } @conf.merge!(conf) - @heartbeat_at = Time.now + @heartbeat_at = Time.now - 1.minutes @liveness = 0 @reply_to = nil @reply_rid = nil @reply_service = nil @@ -38,17 +38,17 @@ request = [Pigato::C_CLIENT, Pigato::W_HEARTBEAT, "worker", sid] msg = ZMQ::Message.new request.reverse.each{|p| msg.push(ZMQ::Frame(p))} client.send msg end - @@global_heartbeat_at = Time.now + 1 + @@global_heartbeat_at = Time.now + 2.5 end rescue => e puts e end @@mtx.unlock - sleep 1 + sleep 2.5 end end end def reply reply @@ -105,10 +105,10 @@ end end if Time.now > @heartbeat_at send(Pigato::W_HEARTBEAT, ['', Oj.dump({ 'concurrency' => 1 })]) - @heartbeat_at = Time.now + 0.001 * @conf[:timeout] + @heartbeat_at = Time.now + 0.001 * (@conf[:timeout] * 1.5) end val end