mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
styling: Enforced styling across all files (#55)
This commit is contained in:
165 files changed
+1879
-1725
No files matched your search
+9
-10
@@ -65,20 +65,19 @@ export function generateConnectionPool() {
|
||||
|
||||
export const pool = generateConnectionPool();
|
||||
|
||||
|
||||
export async function withTransaction(queries: Promise<any>[]): Promise<any[]> {
|
||||
const connection = await pool.getConnection()
|
||||
const connection = await pool.getConnection();
|
||||
connection.beginTransaction();
|
||||
|
||||
try {
|
||||
const results = await Promise.all(queries)
|
||||
await connection.commit()
|
||||
await connection.release()
|
||||
const results = await Promise.all(queries);
|
||||
await connection.commit();
|
||||
await connection.release();
|
||||
return results;
|
||||
} catch (err) {
|
||||
console.warn('Error when submitting queries');
|
||||
await connection.rollback()
|
||||
await connection.release()
|
||||
return Promise.reject(err)
|
||||
console.warn("Error when submitting queries");
|
||||
await connection.rollback();
|
||||
await connection.release();
|
||||
return Promise.reject(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user