realtime shouldn't poll forever if the dev server isn't up (#931)

This commit is contained in:
Devin Howard 2016-11-24 14:40:14 -05:00 committed by GitHub
parent 95b8b52224
commit 5d8ff3efce

View file

@ -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() {