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

fix: ignore connection refused error while reconnecting #170

Merged
merged 3 commits into from
May 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/platform/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Module.connectServer = function () {
});

client.on('connect', function () {
if (retryInterval) {
if (retryInterval !== null) {
clearInterval(retryInterval);
console.log('[LiveView]', 'Reconnected to Event Server');
}
Expand Down Expand Up @@ -149,6 +149,10 @@ Module.connectServer = function () {

client.on('error', function (e) {
let err = e.error;
if (retryInterval !== null && err.includes('Connection refused')) {
return;
}

const code = ~~e.code;
if (code === 61) {
err = 'Event Server unavailable. Connection Refused @ '
Expand Down