Skip to content

Commit 4f6da4e

Browse files
GHMattiGHMatti
authored andcommitted
chore: update to 3.2.3
1 parent 3af004e commit 4f6da4e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ game 'common'
44
name 'mysql-async'
55
description 'MySQL Middleware for lua.'
66
author 'Joel Wurtz & Matthias Mandelartz'
7-
version '3.2.2'
7+
version '3.2.3'
88
url 'https://github.com/brouznouf/fivem-mysql-async'
99

1010
server_script 'mysql-async.js'

mysql-async.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,6 +5198,10 @@ global.on('onResourceStart', (resourcename) => {
51985198
}
51995199
});
52005200

5201+
global.RegisterCommand('mysql:debug', () => {
5202+
profiler.config.trace = !profiler.config.trace;
5203+
}, true);
5204+
52015205
global.onNet('mysql-async:request-data', () => {
52025206
if (isReady) {
52035207
const src = global.source;
@@ -5274,6 +5278,8 @@ class MySQL {
52745278
});
52755279
}).catch((error) => {
52765280
this.logger.error(`[ERROR] [MySQL] [${invokingResource}] An error happens on MySQL for query "${sql.sql}": ${error.message}`);
5281+
// We should not catch this error when doing a transaction, throw new error instead.
5282+
if (connection) throw new Error('This error might result from a transaction and be deliberate.');
52775283
});
52785284

52795285
return queryPromise;
@@ -5309,6 +5315,9 @@ class MySQL {
53095315
// Otherwise catch the error from the execution
53105316
}).catch((executeError) => {
53115317
this.onTransactionError(executeError, connection, callback);
5318+
}).then(() => {
5319+
// terminate connection
5320+
connection.release();
53125321
});
53135322
}
53145323
}

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mysql-async",
3-
"version": "3.2.2",
3+
"version": "3.2.3",
44
"description": "fivem-mysql-async",
55
"private": true,
66
"scripts": {

0 commit comments

Comments
 (0)