Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/MySQL.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion mysql-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -16296,4 +16299,4 @@ onNet('mysql-async:request-server-status', () => {
});

/***/ })
/******/ ]);
/******/ ]);