mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Properly await termination.
This commit is contained in:
20
server.ts
20
server.ts
@@ -535,10 +535,12 @@ function createHttpsServer(keys) {
|
|||||||
|
|
||||||
// Graceful shutdown when signalled
|
// Graceful shutdown when signalled
|
||||||
const terminator = createHttpTerminator({server: listener});
|
const terminator = createHttpTerminator({server: listener});
|
||||||
process.on('SIGINT', ()=> {
|
process.on('SIGINT', () => {
|
||||||
console.debug('Closing HTTPS server on signal');
|
void (async ()=> {
|
||||||
terminator.terminate().catch(e => { console.error(e); });
|
console.debug('Closing HTTPS server on signal');
|
||||||
console.debug('HTTPS server closed');
|
await terminator.terminate().catch(e => { console.error(e); });
|
||||||
|
console.debug('HTTPS server closed');
|
||||||
|
})();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -554,10 +556,12 @@ function run() {
|
|||||||
|
|
||||||
// Graceful shutdown when signalled
|
// Graceful shutdown when signalled
|
||||||
const terminator = createHttpTerminator({server: listener});
|
const terminator = createHttpTerminator({server: listener});
|
||||||
process.on('SIGINT', ()=> {
|
process.on('SIGINT', () => {
|
||||||
console.debug('Closing HTTP server on signal');
|
void (async () => {
|
||||||
terminator.terminate().catch(e => { console.error(e); });
|
console.debug('Closing HTTP server on signal');
|
||||||
console.debug('HTTP server closed.');
|
await terminator.terminate().catch(e => { console.error(e); });
|
||||||
|
console.debug('HTTP server closed.');return undefined;
|
||||||
|
})();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user