Skip to content

Commit

Permalink
chore: update to 3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
GHMatti authored and GHMatti committed May 23, 2020
1 parent 3af004e commit 4f6da4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ game 'common'
name 'mysql-async'
description 'MySQL Middleware for lua.'
author 'Joel Wurtz & Matthias Mandelartz'
version '3.2.2'
version '3.2.3'
url 'https://github.com/brouznouf/fivem-mysql-async'

server_script 'mysql-async.js'
Expand Down
9 changes: 9 additions & 0 deletions mysql-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -5198,6 +5198,10 @@ global.on('onResourceStart', (resourcename) => {
}
});

global.RegisterCommand('mysql:debug', () => {
profiler.config.trace = !profiler.config.trace;
}, true);

global.onNet('mysql-async:request-data', () => {
if (isReady) {
const src = global.source;
Expand Down Expand Up @@ -5274,6 +5278,8 @@ class MySQL {
});
}).catch((error) => {
this.logger.error(`[ERROR] [MySQL] [${invokingResource}] An error happens on MySQL for query "${sql.sql}": ${error.message}`);
// We should not catch this error when doing a transaction, throw new error instead.
if (connection) throw new Error('This error might result from a transaction and be deliberate.');
});

return queryPromise;
Expand Down Expand Up @@ -5309,6 +5315,9 @@ class MySQL {
// Otherwise catch the error from the execution
}).catch((executeError) => {
this.onTransactionError(executeError, connection, callback);
}).then(() => {
// terminate connection
connection.release();
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mysql-async",
"version": "3.2.2",
"version": "3.2.3",
"description": "fivem-mysql-async",
"private": true,
"scripts": {
Expand Down

0 comments on commit 4f6da4e

Please sign in to comment.