mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
fix(db/connection): don't establish connection from getPoolConnection
Should prevent connection timeouts when queries are called during server startup.
This commit is contained in:
1 parent
0f5f397814
commit
3fef918000
1 file changed
+2
-6
@@ -13,7 +13,7 @@ export async function waitForConnection() {
|
||||
}
|
||||
}
|
||||
|
||||
async function createConnectionPool() {
|
||||
export async function createConnectionPool() {
|
||||
try {
|
||||
pool = createPool(connectionOptions);
|
||||
|
||||
@@ -39,11 +39,7 @@ async function createConnectionPool() {
|
||||
}
|
||||
|
||||
export async function getPoolConnection() {
|
||||
if (!pool) {
|
||||
await createConnectionPool();
|
||||
|
||||
if (!pool) return;
|
||||
}
|
||||
if (!isServerConnected) await waitForConnection()
|
||||
|
||||
scheduleTick();
|
||||
|
||||
|
||||
Reference in new issue
Block a user