Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop sockjs from multiplying on reconnect #888

Merged
merged 2 commits into from May 11, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -22,6 +22,7 @@ function DataUpdater(allViewModels) {
};

self.reconnect = function() {
self._socket.close();
delete self._socket;
self.connect();
};
@@ -31,7 +32,10 @@ function DataUpdater(allViewModels) {
self._autoReconnectTrial = 0;
};

self._onclose = function() {
self._onclose = function(e) {
if (e.code == SOCKJS_CLOSE_NORMAL) {
return;
}
if (self._autoReconnectTrial >= self._autoReconnectDialogIndex) {
// Only consider it a real disconnect if the trial number has exceeded our threshold.

@@ -20,6 +20,8 @@
var SOCKJS_URI = "{{ url_for('index') }}" + "sockjs";
var SOCKJS_DEBUG = CONFIG_DEBUG;
// sockjs should define CLOSE_NORMAL for us, but they don't (from ws spec)
var SOCKJS_CLOSE_NORMAL = 1000
var UI_API_KEY = "{{ uiApiKey }}";
var VERSION = "{{ version }}";
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.