From bbc2529ac6d9ac0987a43d47d168d85c95256390 Mon Sep 17 00:00:00 2001 From: tokebe <43009413+tokebe@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:14:26 -0400 Subject: [PATCH] fix: don't reinitialize count object --- src/inferred_mode/inferred_mode.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inferred_mode/inferred_mode.ts b/src/inferred_mode/inferred_mode.ts index babb400..2f491d3 100644 --- a/src/inferred_mode/inferred_mode.ts +++ b/src/inferred_mode/inferred_mode.ts @@ -630,6 +630,9 @@ export default class InferredQueryHandler { [resultID: string]: number; } = {}; const auxGraphSuffixes: { [inferredEdgeID: string]: number } = {}; + if (global.queryInformation != null) { + global.queryInformation.totalRecords = {}; + } const completedHandlers = await Promise.all( subQueries.map(async ({ template, queryGraph, qualifiers }, i) => { @@ -641,10 +644,7 @@ export default class InferredQueryHandler { this.predicatePath, this.includeReasoner, ); - if (global.queryInformation != null) { - global.queryInformation.totalRecords = {}; - global.queryInformation.totalRecords[i] = 0; // Ensure 0 starting for each template - } + global.queryInformation.totalRecords[i] = 0; // Ensure 0 starting for each template handler.setQueryGraph(queryGraph); const failedHandlerLogs: { [index: number]: StampedLog[] } = {}; try {