mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
refactor(utils/scheduleTick): Await database connection
This commit is contained in:
1 parent
2d28c447ec
commit
ec53b3282d
6 files changed
+30
-13
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { QueryError, ResultSetHeader, RowDataPacket } from 'mysql2';
|
||||
import { pool } from '.';
|
||||
import { scheduleTick } from '../config';
|
||||
import { logQuery } from '../logger';
|
||||
import { CFXCallback, CFXParameters, QueryResponse } from '../types';
|
||||
import { parseResponse } from '../utils/parseResponse';
|
||||
import { parseExecute } from '../utils/parseExecute';
|
||||
import { scheduleTick } from '../utils/scheduleTick';
|
||||
|
||||
export const rawExecute = async (
|
||||
invokingResource: string,
|
||||
@@ -19,7 +19,7 @@ export const rawExecute = async (
|
||||
if (!Array.isArray(parameters))
|
||||
throw new Error(`Parameters expected an array but received ${typeof parameters} instead`);
|
||||
|
||||
scheduleTick();
|
||||
await scheduleTick();
|
||||
|
||||
const connection = await pool.getConnection();
|
||||
let result: QueryResponse;
|
||||
|
||||
Reference in new issue
Block a user