fix(execute): revert to promise api

Several reports of increased chances to hit a deadlock since v2.2.2, and
three reports of a timeout during prepare since v2.2.4.
Simpler to revert to the old prepare function and api (with improvements)
than to work out the solution.

Look into rewriting prepare in the future or including the mariadb connector,
which doesn't suffer from the same perf issues.
This commit is contained in:
Linden committed 2022-04-03 06:10:13 +11:00
1 parent fa1cdcc668
commit 050eef58b9
4 files changed
+45 -65

No files matched your search

+1
View File
@@ -17,6 +17,7 @@ export const rawQuery = async (
[query, parameters, cb] = parseArguments(invokingResource, query, parameters, cb);
return await new Promise((resolve, reject) => {
//@ts-expect-error todo: patch type with executionTime
pool.query(query, parameters, (err, result, _, executionTime) => {
if (err) return reject(err);