Fixed possible bug: callback called twice
This commit is contained in:
parent
963aef53b5
commit
f73eb026b6
2 changed files with 6 additions and 0 deletions
|
@ -99,6 +99,9 @@ module.exports = callback => {
|
|||
});
|
||||
|
||||
server.listen(config.postfixbounce.port, config.postfixbounce.host, () => {
|
||||
if (started) {
|
||||
return server.close();
|
||||
}
|
||||
started = true;
|
||||
log.info('POSTFIXBOUNCE', 'Server listening on port %s', config.postfixbounce.port);
|
||||
setImmediate(callback);
|
||||
|
|
|
@ -147,6 +147,9 @@ module.exports = callback => {
|
|||
}
|
||||
let host = hosts[pos++];
|
||||
server.listen(config.verp.port, host, () => {
|
||||
if (started) {
|
||||
return server.close();
|
||||
}
|
||||
log.info('VERP', 'Server listening on %s:%s', host || '*', config.verp.port);
|
||||
setImmediate(startNextHost);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue