mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
refactor(db): loop createConnectionPool until success
This commit is contained in:
1 parent
3fef918000
commit
17841acc45
1 file changed
+9
-3
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user