refactor(db): loop createConnectionPool until success

This commit is contained in:
Linden committed 2023-11-28 12:01:55 +11:00
1 parent 3fef918000
commit 17841acc45
1 file changed
+9 -3
+9 -3
View File
@@ -1,9 +1,15 @@
import { setDebug } from '../config';
import { getPoolConnection } from './connection';
import { sleep } from '../utils/sleep';
import { createConnectionPool, isServerConnected } from './connection';
setTimeout(() => {
setTimeout(async () => {
setDebug();
getPoolConnection();
while (!isServerConnected) {
await createConnectionPool();
if (!isServerConnected) await sleep(30000);
}
});
setInterval(() => {