Merge branch 'main' into git-main
This commit is contained in:
@@ -23,6 +23,15 @@ class NotificationService {
|
||||
console.log(`Notification service listening on port ${port}`);
|
||||
resolve();
|
||||
});
|
||||
|
||||
this.server.on('error', (error) => {
|
||||
if (error.code === 'EADDRINUSE') {
|
||||
console.log(`Port ${port} is in use, trying port ${port + 1}`);
|
||||
this.start(port + 1).then(resolve).catch(reject);
|
||||
} else {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user