From be67e367b407f1b405efadc2b0390a0735c6868e Mon Sep 17 00:00:00 2001 From: meta-hub <56391287+meta-hub@users.noreply.github.com> Date: Fri, 10 Dec 2021 15:41:08 +1030 Subject: [PATCH 1/2] Update MySQL.lua --- lib/MySQL.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/MySQL.lua b/lib/MySQL.lua index 4d91760..2f86c78 100644 --- a/lib/MySQL.lua +++ b/lib/MySQL.lua @@ -214,15 +214,26 @@ function MySQL.Async.transaction(querys, params, func) return exports['mysql-async']:mysql_transaction(querys, params, func) end -function MySQL.ready (callback) +--- +-- Get the config object +-- +-- @return table config +-- +function MySQL.getConfig() + return exports['mysql-async']:get_config() +end + +function MySQL.ready(callback) Citizen.CreateThread(function () -- add some more error handling while GetResourceState('mysql-async') ~= 'started' do Citizen.Wait(0) end + while not exports['mysql-async']:is_ready() do Citizen.Wait(0) end + callback() end) end From 8c261ee5814573c1c6c43b17911b2a42bff4deef Mon Sep 17 00:00:00 2001 From: meta-hub <56391287+meta-hub@users.noreply.github.com> Date: Fri, 10 Dec 2021 16:11:44 +1030 Subject: [PATCH 2/2] Update mysql-async.js --- mysql-async.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-async.js b/mysql-async.js index f94d7b3..e332d25 100644 --- a/mysql-async.js +++ b/mysql-async.js @@ -16263,6 +16263,9 @@ global.exports('mysql_store', (query, callback) => { server_server.logger.info(`[${invokingResource}] Stored [${storageId}] : ${query}`); utility_safeInvoke(callback, storageId); }); +global.exports('get_config', () => { + return server_config; +}); RegisterCommand('mysql:debug', () => { let trace = false; @@ -16296,4 +16299,4 @@ onNet('mysql-async:request-server-status', () => { }); /***/ }) -/******/ ]); \ No newline at end of file +/******/ ]);