refactor(prod sql): removed closeing the pool that was weird
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { returnFunc } from "../utils/returnHelper.utils.js";
|
import { returnFunc } from "../utils/returnHelper.utils.js";
|
||||||
import {
|
import {
|
||||||
closePool,
|
|
||||||
connected,
|
connected,
|
||||||
pool,
|
pool,
|
||||||
reconnecting,
|
reconnecting,
|
||||||
@@ -64,7 +63,6 @@ export const prodQuery = async (queryToRun: string, name: string) => {
|
|||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
const err = error as SqlError;
|
const err = error as SqlError;
|
||||||
if (err.code === "ETIMEOUT") {
|
if (err.code === "ETIMEOUT") {
|
||||||
closePool();
|
|
||||||
return returnFunc({
|
return returnFunc({
|
||||||
success: false,
|
success: false,
|
||||||
module: "system",
|
module: "system",
|
||||||
@@ -77,7 +75,6 @@ export const prodQuery = async (queryToRun: string, name: string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err.code === "EREQUEST") {
|
if (err.code === "EREQUEST") {
|
||||||
closePool();
|
|
||||||
return returnFunc({
|
return returnFunc({
|
||||||
success: false,
|
success: false,
|
||||||
module: "system",
|
module: "system",
|
||||||
|
|||||||
Reference in New Issue
Block a user