Skip to content

Commit

Permalink
Tsify lib/handlers/health-check (#4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Jan 24, 2023
1 parent 42ba1bf commit cde6bd7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/handlers/health-check.js → lib/handlers/health-check.ts
Expand Up @@ -24,18 +24,19 @@

import * as Sentry from '@sentry/node';
import fs from 'fs-extra';
import express from 'express';

import {logger} from '../logger';
import {CompilationQueue} from '../compilation-queue';

export class HealthCheckHandler {
constructor(compilationQueue, filePath) {
this.compilationQueue = compilationQueue;
this.filePath = filePath;
public readonly handle: (req: any, res: any) => Promise<void>;

constructor(private readonly compilationQueue: CompilationQueue, private readonly filePath: any) {
this.handle = this._handle.bind(this);
}

async _handle(req, res) {
async _handle(req: express.Request, res: express.Response) {
/* wait on an empty job to pass through the compilation queue
* to ensure the health check will timeout if it is deadlocked
*
Expand Down

0 comments on commit cde6bd7

Please sign in to comment.