Browse Source

Minor improvements

pull/6897/head
Igor Kulikov 4 years ago
parent
commit
1d9d938052
  1. 3
      msa/js-executor/docker/start-js-executor.sh
  2. 4
      msa/js-executor/package.json
  3. 5
      msa/js-executor/server.ts

3
msa/js-executor/docker/start-js-executor.sh

@ -26,4 +26,5 @@ source "${CONF_FOLDER}/${configfile}"
cd ${pkg.installFolder}
exec /bin/sh -c "node server.js"
# This will forward this PID 1 to the node.js and forward SIGTERM for graceful shutdown as well
exec node server.js

4
msa/js-executor/package.json

@ -8,8 +8,8 @@
"scripts": {
"pkg": "tsc && pkg -t node16-linux-x64,node16-win-x64 --out-path ./target ./target/src && node install.js",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon --watch '.' --ext 'ts' --exec 'WEB_FOLDER=./target/web ts-node server.ts'",
"start-prod": "nodemon --watch '.' --ext 'ts' --exec 'WEB_FOLDER=./target/web NODE_ENV=production ts-node server.ts'",
"start": "nodemon --watch '.' --ext 'ts' --exec 'ts-node server.ts'",
"start-prod": "nodemon --watch '.' --ext 'ts' --exec 'NODE_ENV=production ts-node server.ts'",
"build": "tsc"
},
"dependencies": {

5
msa/js-executor/server.ts

@ -71,7 +71,8 @@ let httpServer: HttpServer;
})();
process.on('SIGTERM', () => {
process.exit();
logger.info('SIGTERM signal received');
process.exit(0);
});
process.on('exit', async () => {
@ -81,5 +82,5 @@ process.on('exit', async () => {
if (queues) {
queues.exit(0);
}
logger.info('JavaScript Executor Microservice has been stopped.');
});

Loading…
Cancel
Save