提交 9ad20352 编写于 作者: P Pratik Naik

Be sure to initialize @heartbeat_timer. Third time is a charm!

上级 935d0450
......@@ -22,8 +22,8 @@ def remove_connection(connection)
# then can't rely on being able to receive and send to it. So there's a 3 second heartbeat running on all connections. If the beat fails, we automatically
# disconnect.
def setup_heartbeat_timer
@heartbeat_timer ||= EM.next_tick do
EventMachine.add_periodic_timer(BEAT_INTERVAL) do
EM.next_tick do
@heartbeat_timer ||= EventMachine.add_periodic_timer(BEAT_INTERVAL) do
EM.next_tick { connections.map &:beat }
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册