hmm node 20, yummy

isekai-main
Barış Soner Uşaklı 1 year ago
parent 5c14438d36
commit 5602159691

@ -5,12 +5,10 @@ on:
branches: branches:
- master - master
- develop - develop
- bootstrap5
pull_request: pull_request:
branches: branches:
- master - master
- develop - develop
- bootstrap5
defaults: defaults:
run: run:
@ -29,19 +27,19 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
node: [16, 18] node: [16, 18, 20]
database: [mongo-dev, mongo, redis, postgres] database: [mongo-dev, mongo, redis, postgres]
include: include:
# only run coverage once # only run coverage once
- os: ubuntu-latest - os: ubuntu-latest
node: 16 node: 18
coverage: true coverage: true
# test under development once # test under development once
- database: mongo-dev - database: mongo-dev
test_env: development test_env: development
# only run eslint once # only run eslint once
- os: ubuntu-latest - os: ubuntu-latest
node: 16 node: 18
database: mongo-dev database: mongo-dev
lint: true lint: true
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

@ -95,8 +95,9 @@ function printStartupInfo() {
} }
function addProcessHandlers() { function addProcessHandlers() {
process.on('SIGTERM', shutdown); ['SIGTERM', 'SIGINT', 'SIGQUIT'].forEach((signal) => {
process.on('SIGINT', shutdown); process.on(signal, () => shutdown());
});
process.on('SIGHUP', restart); process.on('SIGHUP', restart);
process.on('uncaughtException', (err) => { process.on('uncaughtException', (err) => {
winston.error(err.stack); winston.error(err.stack);
@ -130,7 +131,7 @@ function restart() {
} }
async function shutdown(code) { async function shutdown(code) {
winston.info('[app] Shutdown (SIGTERM/SIGINT) Initialised.'); winston.info('[app] Shutdown (SIGTERM/SIGINT/SIGQUIT) Initialised.');
try { try {
await require('./webserver').destroy(); await require('./webserver').destroy();
winston.info('[app] Web server closed to connections.'); winston.info('[app] Web server closed to connections.');
@ -142,6 +143,7 @@ async function shutdown(code) {
process.exit(code || 0); process.exit(code || 0);
} catch (err) { } catch (err) {
winston.error(err.stack); winston.error(err.stack);
return process.exit(code || 0); return process.exit(code || 0);
} }
} }

Loading…
Cancel
Save