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:
Linden committed 2023-11-28 12:01:55 +11:00
1 parent 0f5f397814
commit 3fef918000
1 file changed
+2 -6
+2 -6
View File
@@ -13,7 +13,7 @@ export async function waitForConnection() {
} }
} }
async function createConnectionPool() { export async function createConnectionPool() {
try { try {
pool = createPool(connectionOptions); pool = createPool(connectionOptions);
@@ -39,11 +39,7 @@ async function createConnectionPool() {
} }
export async function getPoolConnection() { export async function getPoolConnection() {
if (!pool) { if (!isServerConnected) await waitForConnection()
await createConnectionPool();
if (!pool) return;
}
scheduleTick(); scheduleTick();