mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
refactor(database): waitForConnection
This commit is contained in:
1 parent
2a5e110e29
commit
bc8a874743
5 files changed
+30
-22
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { pool } from '.';
|
||||
import { pool, serverReady, waitForConnection } from '.';
|
||||
import { parseArguments } from '../utils/parseArguments';
|
||||
import { parseResponse } from '../utils/parseResponse';
|
||||
import { logQuery } from '../logger';
|
||||
import type { CFXCallback, CFXParameters, QueryResponse } from '../types';
|
||||
import type { CFXCallback, CFXParameters } from '../types';
|
||||
import type { QueryType } from '../types';
|
||||
import { scheduleTick } from '../utils/scheduleTick';
|
||||
|
||||
@@ -14,7 +14,9 @@ export const rawQuery = async (
|
||||
cb?: CFXCallback,
|
||||
throwError?: boolean
|
||||
) => {
|
||||
await scheduleTick();
|
||||
if (!serverReady) await waitForConnection()
|
||||
|
||||
scheduleTick();
|
||||
[query, parameters, cb] = parseArguments(invokingResource, query, parameters, cb);
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
|
||||
Reference in new issue
Block a user