fix: performance tweaks

Moved getConnection and ScheduleResourceTick above the try block.
Moved connection.release into the finally block
Increased default connection timeout to 1 minute.
This commit is contained in:
Linden committed 2021-12-06 17:55:50 +11:00
1 parent 87a5123117
commit 45b90c4ad3
4 files changed
+19 -12

No files matched your search

+7 -1
View File
@@ -22,8 +22,14 @@ const dbOptions = (() => {
return connectionInfo;
}, {});
options.namedPlaceholders = true;
options.typeCast = parseTypes;
options.namedPlaceholders = true;
// increase the default timeout for slow servers
options.connectTimeout = options.connectTimeout || 60000;
// disabled to prevent SQL injection
options.multipleStatements = options.multipleStatements || false;
return options;
})();