This repository was archived by the owner on Apr 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ game 'common'
3
3
4
4
name ' oxmysql'
5
5
description ' Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
6
- version ' 1.8.6 '
6
+ version ' 1.8.7 '
7
7
url ' https://github.com/overextended/oxmysql'
8
8
author ' overextended'
9
9
use_fxv2_oal ' yes'
Original file line number Diff line number Diff line change @@ -5,18 +5,20 @@ import { FormatError } from './errors';
5
5
6
6
let isReady = false ;
7
7
8
- const serverReady = ( ) => {
9
- return new Promise ( ( ) => {
10
- setTimeout ( ( ) => {
11
- return true ;
12
- } ) ;
8
+ const serverReady = async ( ) => {
9
+ return new Promise ( ( resolve ) => {
10
+ const id = setInterval ( ( ) => {
11
+ if ( GetResourceState ( resourceName ) == 'started' ) resolve ( id ) ;
12
+ } , 50 ) ;
13
+ } ) . then ( ( id ) => {
14
+ clearInterval ( id ) ;
15
+ isReady = true ;
13
16
} ) ;
14
17
} ;
15
18
16
19
setImmediate ( async ( ) => {
17
20
try {
18
21
await pool . query ( isolationLevel ) ;
19
- isReady = true ;
20
22
console . log ( `^2Database server connection established!^0` ) ;
21
23
} catch ( error ) {
22
24
console . log ( `^3Unable to establish a connection to the database! [${ error . code } ]\n${ error . message } ^0` ) ;
You can’t perform that action at this time.
0 commit comments