mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
refactor(database): add new connection class and misc tweaks
Use disposable symbol to ensure connection cleanup. Improvements to internal types. Code splitting and removal of redundant variables.
This commit is contained in:
1 parent
19d55a21ed
commit
c38f646bb9
14 files changed
+162
-125
No files matched your search
@@ -1,14 +1,14 @@
|
||||
import { setDebug } from '../config';
|
||||
import { sleep } from '../utils/sleep';
|
||||
import { createConnectionPool, isServerConnected } from './connection';
|
||||
import { pool, createConnectionPool } from './pool';
|
||||
|
||||
setTimeout(async () => {
|
||||
setDebug();
|
||||
|
||||
while (!isServerConnected) {
|
||||
while (!pool) {
|
||||
await createConnectionPool();
|
||||
|
||||
if (!isServerConnected) await sleep(30000);
|
||||
if (!pool) await sleep(30000);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,3 +20,4 @@ export * from './connection';
|
||||
export * from './rawQuery';
|
||||
export * from './rawExecute';
|
||||
export * from './rawTransaction';
|
||||
export * from './pool';
|
||||
Reference in new issue
Block a user