From 63841389bc1e81d00cf772177b45a79c04842b45 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Mon, 23 Jan 2023 15:07:26 +0000 Subject: [PATCH] chore: adjust safeCatch timeout --- packages/common/src/safeCatch.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/common/src/safeCatch.ts b/packages/common/src/safeCatch.ts index fde7c6fe..4cab0c23 100644 --- a/packages/common/src/safeCatch.ts +++ b/packages/common/src/safeCatch.ts @@ -4,7 +4,8 @@ import { logger } from './Logger' let c = 0 export const safeCatch = ( name: string, - cb: (...args: TIn) => Promise + cb: (...args: TIn) => Promise, + timeoutMs = 5000 ) => { return (...args: TIn) => { const _c = c++ @@ -13,8 +14,8 @@ export const safeCatch = ( const { raw, error, warn } = logger().create(pfx) raw(`args`, args) const tid = setTimeout(() => { - warn(`timeout waiting for ${pfx}`) - }, 100) + error(`timeout ${timeoutMs}ms waiting for ${pfx}`) + }, timeoutMs) return cb(...args) .then((res) => {