From 5d8ff3efce79701736748bc3e071307ef7743227 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Thu, 24 Nov 2016 14:40:14 -0500 Subject: [PATCH] realtime shouldn't poll forever if the dev server isn't up (#931) --- frontend/src/Metamaps/Realtime/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/Metamaps/Realtime/index.js b/frontend/src/Metamaps/Realtime/index.js index 952b835c..318753f0 100644 --- a/frontend/src/Metamaps/Realtime/index.js +++ b/frontend/src/Metamaps/Realtime/index.js @@ -111,7 +111,13 @@ let Realtime = { self.addJuntoListeners() - self.socket = new SocketIoConnection({ url: serverData['REALTIME_SERVER'] }) + self.socket = new SocketIoConnection({ + url: serverData['REALTIME_SERVER'], + socketio: { + // don't poll forever if in development + reconnectionAttempts: serverData.RAILS_ENV === 'development' ? 5 : Infinity + } + }) self['junto_spinner_darkgrey.gif'] = serverData['junto_spinner_darkgrey.gif'] self.socket.on('connect', function() {