mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
fix(execute): incorrect execution time for multiple queries
When sending bulk-statements using prepare, the execution time would always be calculated based on the start of the first query. This would mistakenly report successive queries as taking longer, and possibly report slow queries (i.e. when saving all players).
This commit is contained in:
1 parent
9fec9cccba
commit
f82fa72643
1 file changed
+1
-1
@@ -24,11 +24,11 @@ export const rawExecute = async (
|
||||
try {
|
||||
const placeholders = query.split('?').length - 1;
|
||||
const results = [] as RowDataPacket;
|
||||
const executionTime = process.hrtime();
|
||||
|
||||
if (type !== null) await connection.beginTransaction();
|
||||
|
||||
for (let values of parameters as CFXParameters[]) {
|
||||
const executionTime = process.hrtime();
|
||||
values = parseValues(placeholders, values);
|
||||
const [rows] = (await connection.execute(query, values)) as RowDataPacket[][];
|
||||
|
||||
|
||||
Reference in new issue
Block a user