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 EADDRINUSE impress issue #1890 #455

Merged
merged 3 commits into from
Oct 3, 2023

Conversation

MarhiievHE
Copy link
Member

Suggestions for solving the problem: metarhia/impress#1890

  • tests and linter show no problems (npm t)
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md

@MarhiievHE MarhiievHE changed the title Fix EADDRINUSE impress issue #1890 WP: Fix EADDRINUSE impress issue #1890 Sep 28, 2023
@MarhiievHE MarhiievHE changed the title WP: Fix EADDRINUSE impress issue #1890 WIP: Fix EADDRINUSE impress issue #1890 Sep 28, 2023
lib/server.js Outdated
if (err.code !== 'EADDRINUSE') return;
tryToStartCounter++;
if (tryToStartCounter > 3) return void this.emit('error', err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add retry to options with default value from const instead of hardcoding 3

lib/server.js Outdated
@@ -10,6 +10,7 @@ const { MetaReadable, MetaWritable, chunkDecode } = require('./streams.js');

const SHORT_TIMEOUT = 500;
const EMPTY_PACKET = Buffer.from('{}');
let tryToStartCounter = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to Server instance because we may have multiple Server instances

@tshemsedinov tshemsedinov merged commit 14eeffd into metarhia:master Oct 3, 2023
@tshemsedinov tshemsedinov changed the title WIP: Fix EADDRINUSE impress issue #1890 Fix EADDRINUSE impress issue #1890 Oct 3, 2023
tshemsedinov added a commit that referenced this pull request Oct 4, 2023
@tshemsedinov tshemsedinov mentioned this pull request Oct 4, 2023
5 tasks
tshemsedinov added a commit that referenced this pull request Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants