Skip to content

Commit

Permalink
Update compare_drill_aggregated_csv.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeghana authored Nov 29, 2024
1 parent ffd44a1 commit 457716c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions bin/scripts/data-reports/compare_drill_aggregated.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,10 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection("
console.log("Summary report saved to '" + path + "'.");

console.log(JSON.stringify(endReport));
process.exit();

close();
} catch (err) {
console.error("Failed to save partial report:", err);
process.exit();

}

}).catch(function(eee) {
Expand Down Expand Up @@ -261,6 +260,18 @@ Promise.all([pluginManager.dbConnection("countly"), pluginManager.dbConnection("
return close();
});
}
function close() {
try {
if (countlyDb?.close) countlyDb.close();
if (drillDb?.close) drillDb.close();
} catch (err) {
console.error("Error occurred while closing database connections:", err);
} finally {
console.log("Done.");
console.log("EXITING...");
}
}

});
}).catch(function(eee) {
console.log("Error while fetching data");
Expand Down Expand Up @@ -316,17 +327,6 @@ function getDataFromDrill(options, callback) {
});
}

function close() {
try {
if (countlyDb?.close) countlyDb.close();
if (drillDb?.close) drillDb.close();
} catch (err) {
console.error("Error occurred while closing database connections:", err);
} finally {
console.log("Done.");
console.log("EXITING...");
}
}

function getAppList(options, callback) {
var query = {};
Expand Down

0 comments on commit 457716c

Please sign in to comment.