mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-09-10 12:25:58 -05:00
Make all Node.js servers exit on SIGTERM
This prevents the extra 10-second delay when restating the servers.
This commit is contained in:
12
patches/BOSS/exit-on-sigterm.patch
Normal file
12
patches/BOSS/exit-on-sigterm.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git i/src/server.ts w/src/server.ts
|
||||
index 5db5542..f4c1d47 100644
|
||||
--- i/src/server.ts
|
||||
+++ w/src/server.ts
|
||||
@@ -1,4 +1,7 @@
|
||||
process.title = 'Pretendo - BOSS';
|
||||
+process.on('SIGTERM', () => {
|
||||
+ process.exit(0);
|
||||
+});
|
||||
|
||||
import express from 'express';
|
||||
import morgan from 'morgan';
|
||||
14
patches/account/exit-on-sigterm.patch
Normal file
14
patches/account/exit-on-sigterm.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git i/src/server.ts w/src/server.ts
|
||||
index 797c60e..97638db 100644
|
||||
--- i/src/server.ts
|
||||
+++ w/src/server.ts
|
||||
@@ -3,6 +3,9 @@ process.on('uncaughtException', (err, origin) => {
|
||||
console.log(err);
|
||||
console.log(origin);
|
||||
});
|
||||
+process.on('SIGTERM', () => {
|
||||
+ process.exit(0);
|
||||
+});
|
||||
|
||||
import express from 'express';
|
||||
import morgan from 'morgan';
|
||||
23
patches/juxtaposition-ui/exit-on-sigterm.patch
Normal file
23
patches/juxtaposition-ui/exit-on-sigterm.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git i/src/server.js w/src/server.js
|
||||
index be65907..ff45025 100644
|
||||
--- i/src/server.js
|
||||
+++ w/src/server.js
|
||||
@@ -1,6 +1,11 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
+require('module-alias/register');
|
||||
process.title = 'Pretendo - Juxt-Web';
|
||||
+process.on('SIGTERM', () => {
|
||||
+ process.exit(0);
|
||||
+});
|
||||
+
|
||||
const express = require('express');
|
||||
const morgan = require('morgan');
|
||||
const cookieParser = require('cookie-parser');
|
||||
@@ -88,4 +93,4 @@ async function main() {
|
||||
});
|
||||
}
|
||||
|
||||
-main().catch(console.error);
|
||||
\ No newline at end of file
|
||||
+main().catch(console.error);
|
||||
@@ -18,14 +18,3 @@ index 5132be7..177de10 100644
|
||||
+ "../../../../../../config.json": "/app/config.js"
|
||||
+ }
|
||||
}
|
||||
diff --git i/src/server.js w/src/server.js
|
||||
index be65907..d378132 100644
|
||||
--- i/src/server.js
|
||||
+++ w/src/server.js
|
||||
@@ -1,5 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
+require('module-alias/register');
|
||||
process.title = 'Pretendo - Juxt-Web';
|
||||
const express = require('express');
|
||||
const morgan = require('morgan');
|
||||
|
||||
19
patches/miiverse-api/exit-on-sigterm.patch
Normal file
19
patches/miiverse-api/exit-on-sigterm.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
diff --git i/src/server.ts w/src/server.ts
|
||||
index bc34398..46d42c7 100644
|
||||
--- i/src/server.ts
|
||||
+++ w/src/server.ts
|
||||
@@ -1,4 +1,7 @@
|
||||
process.title = 'Pretendo - Miiverse';
|
||||
+process.on('SIGTERM', () => {
|
||||
+ process.exit(0);
|
||||
+});
|
||||
|
||||
import express from 'express';
|
||||
import morgan from 'morgan';
|
||||
@@ -78,4 +81,4 @@ async function main(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
-main().catch(console.error);
|
||||
\ No newline at end of file
|
||||
+main().catch(console.error);
|
||||
12
patches/website/exit-on-sigterm.patch
Normal file
12
patches/website/exit-on-sigterm.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git i/src/server.js w/src/server.js
|
||||
index b73bdde..04c714b 100644
|
||||
--- i/src/server.js
|
||||
+++ w/src/server.js
|
||||
@@ -1,4 +1,7 @@
|
||||
process.title = 'Pretendo - Website';
|
||||
+process.on('SIGTERM', () => {
|
||||
+ process.exit(0);
|
||||
+});
|
||||
|
||||
const express = require('express');
|
||||
const handlebars = require('express-handlebars');
|
||||
Reference in New Issue
Block a user