From eda3f24dbd5482e331f37cf8f523a6f2e38870cd Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Fri, 1 Sep 2023 19:27:41 -0400 Subject: [PATCH] uncommented --- .../signer/src/common/handler.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/phone-number-privacy/signer/src/common/handler.ts b/packages/phone-number-privacy/signer/src/common/handler.ts index fb8ff5fdee4..59ec0501a62 100644 --- a/packages/phone-number-privacy/signer/src/common/handler.ts +++ b/packages/phone-number-privacy/signer/src/common/handler.ts @@ -99,21 +99,21 @@ export function meteringHandler( } export function timeoutHandler( - _timeoutMs: number, + timeoutMs: number, handler: PromiseHandler ): PromiseHandler { return async (req, res) => { - // const timeoutSignal = (AbortSignal as any).timeout(timeoutMs) - // timeoutSignal.addEventListener( - // 'abort', - // () => { - // if (!res.headersSent) { - // Counters.timeouts.inc() - // sendFailure(ErrorMessage.TIMEOUT_FROM_SIGNER, 500, res, req.url) - // } - // }, - // { once: true } - // ) + const timeoutSignal = (AbortSignal as any).timeout(timeoutMs) + timeoutSignal.addEventListener( + 'abort', + () => { + if (!res.headersSent) { + Counters.timeouts.inc() + sendFailure(ErrorMessage.TIMEOUT_FROM_SIGNER, 500, res, req.url) + } + }, + { once: true } + ) await handler(req, res) }