From 152f308c0659793b19b2d5ee86b22024be1c333e Mon Sep 17 00:00:00 2001 From: Rohan Juneja <rohanj2006@gmail.com> Date: Thu, 2 May 2024 16:06:54 -0700 Subject: [PATCH] fix: handling undefined durationMin --- src/inferred_mode/inferred_mode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inferred_mode/inferred_mode.ts b/src/inferred_mode/inferred_mode.ts index 86b651ed..c665a98b 100644 --- a/src/inferred_mode/inferred_mode.ts +++ b/src/inferred_mode/inferred_mode.ts @@ -529,7 +529,7 @@ export default class InferredQueryHandler { const start = Date.now(); await async.eachOfSeries(subQueries, async ({ template, queryGraph, durationMin }, i) => { - const queryTime = durationMin * 60 * 1000 ?? DEFAULT_QUERY_TIME; + const queryTime = (typeof durationMin == 'number') ? durationMin * 60 * 1000 : DEFAULT_QUERY_TIME; if (Date.now() - start > MAX_TIME - queryTime) { debug(`Skipping template because the query has been running for ${(Date.now() - start) / 1000} seconds, and this template is projected to take ${queryTime / 1000} seconds`); return;