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 {
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();