mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e29905179 |
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ game 'common'
|
|||||||
|
|
||||||
name 'oxmysql'
|
name 'oxmysql'
|
||||||
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
|
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
|
||||||
version '1.8.6'
|
version '1.8.7'
|
||||||
url 'https://github.com/overextended/oxmysql'
|
url 'https://github.com/overextended/oxmysql'
|
||||||
author 'overextended'
|
author 'overextended'
|
||||||
use_fxv2_oal 'yes'
|
use_fxv2_oal 'yes'
|
||||||
|
|||||||
+8
-6
@@ -5,18 +5,20 @@ import { FormatError } from './errors';
|
|||||||
|
|
||||||
let isReady = false;
|
let isReady = false;
|
||||||
|
|
||||||
const serverReady = () => {
|
const serverReady = async () => {
|
||||||
return new Promise(() => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(() => {
|
const id = setInterval(() => {
|
||||||
return true;
|
if (GetResourceState(resourceName) == 'started') resolve(id);
|
||||||
});
|
}, 50);
|
||||||
|
}).then((id) => {
|
||||||
|
clearInterval(id);
|
||||||
|
isReady = true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
setImmediate(async () => {
|
setImmediate(async () => {
|
||||||
try {
|
try {
|
||||||
await pool.query(isolationLevel);
|
await pool.query(isolationLevel);
|
||||||
isReady = true;
|
|
||||||
console.log(`^2Database server connection established!^0`);
|
console.log(`^2Database server connection established!^0`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`^3Unable to establish a connection to the database! [${error.code}]\n${error.message}^0`);
|
console.log(`^3Unable to establish a connection to the database! [${error.code}]\n${error.message}^0`);
|
||||||
|
|||||||
Reference in new issue
Block a user