From eb45763ff0c2dc28bb2002d0dbb12644a99a1ba7 Mon Sep 17 00:00:00 2001 From: Mats Jun Larsen Date: Fri, 29 Nov 2024 00:24:04 +0900 Subject: [PATCH] Add correct types to healthcheck endpoints (#7144) Removes the any types and properly types the option --- app.ts | 2 +- lib/handlers/health-check.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.ts b/app.ts index d5e55801f..2b8054a81 100755 --- a/app.ts +++ b/app.ts @@ -611,7 +611,7 @@ async function main() { process.exit(0); } - const healthCheckFilePath = ceProps('healthCheckFilePath', false); + const healthCheckFilePath = ceProps('healthCheckFilePath', false) as string | false; // Exported to allow compilers to refer to other existing compilers. global.handler_config = { diff --git a/lib/handlers/health-check.ts b/lib/handlers/health-check.ts index f64fcdf6f..95071a90f 100644 --- a/lib/handlers/health-check.ts +++ b/lib/handlers/health-check.ts @@ -32,11 +32,11 @@ import {SentryCapture} from '../sentry.js'; import {ICompileHandler} from './compile.interfaces.js'; export class HealthCheckHandler { - public readonly handle: (req: any, res: any) => Promise; + public readonly handle: (req: express.Request, res: express.Response) => Promise; constructor( private readonly compilationQueue: CompilationQueue, - private readonly filePath: any, + private readonly filePath: string | false, private readonly compileHandler: ICompileHandler, private readonly isExecutionWorker: boolean, ) {