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:
Linden committed 2024-06-17 15:33:39 +10:00
1 parent 19d55a21ed
commit c38f646bb9
14 files changed
+162 -125

No files matched your search

+4 -3
View File
@@ -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';