Skip to content

Commit

Permalink
fix: handling undefined durationMin
Browse files Browse the repository at this point in the history
  • Loading branch information
rjawesome committed May 2, 2024
1 parent a655ea1 commit 152f308
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inferred_mode/inferred_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 152f308

Please sign in to comment.