mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-25 09:30:38 +00:00
fix #157: catch EADDRINUSE to prevent endless restarts if the port is already in use
This commit is contained in:
@@ -124,6 +124,14 @@ if (process.argv.includes('--localhost-only')) {
|
|||||||
server.listen(port);
|
server.listen(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server.on('error', (err) => {
|
||||||
|
if (err.code === 'EADDRINUSE') {
|
||||||
|
console.error(err);
|
||||||
|
console.info("Error EADDRINUSE received, exiting process without restarting process...");
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
class PairDropServer {
|
class PairDropServer {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|||||||
Reference in New Issue
Block a user