1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Pratik Naik 2015-10-08 16:58:20 -05:00
parent 935d0450c0
commit 9ad20352e9

View file

@ -22,8 +22,8 @@ module ActionCable
# 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