chore: Improves linting rule to catch mishandled promises (#5506)

This commit is contained in:
Tom Moor
2023-07-01 13:25:51 -04:00
committed by GitHub
parent 7aec0e24ef
commit f843a20a54
13 changed files with 265 additions and 269 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-misused-promises */
/* eslint-disable import/order */
import env from "./env";
@@ -69,8 +70,8 @@ async function start(id: number, disconnect: () => void) {
const app = new Koa();
const server = stoppable(
useHTTPS
? https.createServer(ssl, app.callback())
: http.createServer(app.callback()),
? https.createServer(ssl, void app.callback())
: http.createServer(void app.callback()),
ShutdownHelper.connectionGraceTimeout
);
const router = new Router();
@@ -162,8 +163,8 @@ async function start(id: number, disconnect: () => void) {
ShutdownHelper.add("metrics", ShutdownOrder.last, () => Metrics.flush());
// Handle shutdown signals
process.once("SIGTERM", () => ShutdownHelper.execute());
process.once("SIGINT", () => ShutdownHelper.execute());
process.once("SIGTERM", () => void ShutdownHelper.execute());
process.once("SIGINT", () => void ShutdownHelper.execute());
}
void throng({