mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +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,4 +1,4 @@
|
||||
import { pool } from '.';
|
||||
import { pool, serverReady, waitForConnection } from '.';
|
||||
import { logQuery } from '../logger';
|
||||
import { CFXParameters, TransactionQuery } from '../types';
|
||||
import { parseTransaction } from '../utils/parseTransaction';
|
||||
@@ -15,7 +15,9 @@ export const rawTransaction = async (
|
||||
parameters: CFXParameters,
|
||||
callback?: (result: boolean) => void
|
||||
) => {
|
||||
await scheduleTick();
|
||||
if (!serverReady) await waitForConnection()
|
||||
|
||||
scheduleTick();
|
||||
|
||||
const { transactions, cb } = parseTransaction(invokingResource, queries, parameters, callback);
|
||||
const connection = await pool.promise().getConnection();
|
||||
|
||||
Reference in new issue
Block a user