ts fixes from reorg + unit test work
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m24s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m24s
This commit is contained in:
@@ -21,13 +21,13 @@ const createPool = (): Pool => {
|
||||
// --- START DEBUG LOGGING ---
|
||||
// Log the database connection details being used by the server process.
|
||||
// This helps confirm it's using the correct .env file for the environment.
|
||||
logger.info('--- [DB POOL] Creating new PostgreSQL connection pool. ---');
|
||||
logger.info(` Host: ${process.env.DB_HOST}`);
|
||||
logger.info(` Port: ${process.env.DB_PORT}`);
|
||||
logger.info(` User: ${process.env.DB_USER}`);
|
||||
logger.info(` Database: ${process.env.DB_DATABASE}`);
|
||||
logger.info(` Pool Instance ID: ${poolId}`);
|
||||
logger.info('----------------------------------------------------');
|
||||
//logger.info('--- [DB POOL] Creating new PostgreSQL connection pool. ---');
|
||||
//logger.info(` Host: ${process.env.DB_HOST}`);
|
||||
//logger.info(` Port: ${process.env.DB_PORT}`);
|
||||
//logger.info(` User: ${process.env.DB_USER}`);
|
||||
//logger.info(` Database: ${process.env.DB_DATABASE}`);
|
||||
//logger.info(` Pool Instance ID: ${poolId}`);
|
||||
//logger.info('----------------------------------------------------');
|
||||
|
||||
const poolConfig: PoolConfig = {
|
||||
user: process.env.DB_USER || 'postgres',
|
||||
@@ -39,7 +39,7 @@ const createPool = (): Pool => {
|
||||
|
||||
const newPool: TrackedPool = new Pool(poolConfig);
|
||||
newPool.poolId = poolId; // Attach the ID to the instance.
|
||||
logger.info(`Database connection pool created for host: ${process.env.DB_HOST || 'localhost'}`);
|
||||
//logger.info(`Database connection pool created for host: ${process.env.DB_HOST || 'localhost'}`);
|
||||
return newPool;
|
||||
};
|
||||
|
||||
@@ -50,10 +50,10 @@ const createPool = (): Pool => {
|
||||
export const getPool = (): Pool => {
|
||||
// This function acts as a singleton accessor for the database pool.
|
||||
if (!poolInstance) {
|
||||
logger.info('--- [DB POOL ACCESSOR] No pool instance found. Creating a new one. ---');
|
||||
//logger.info('--- [DB POOL ACCESSOR] No pool instance found. Creating a new one. ---');
|
||||
poolInstance = createPool();
|
||||
} else {
|
||||
logger.info(`--- [DB POOL ACCESSOR] Returning existing pool instance. ID: ${poolInstance.poolId} ---`);
|
||||
//logger.info(`--- [DB POOL ACCESSOR] Returning existing pool instance. ID: ${poolInstance.poolId} ---`);
|
||||
}
|
||||
return poolInstance;
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ export async function setup() {
|
||||
// --- NEW LOGGING END ---
|
||||
|
||||
serverProcess.stdout?.on('data', (data) => {
|
||||
console.log(`[SERVER STDOUT]: ${data}`);
|
||||
//console.log(`[SERVER STDOUT]: ${data}`);
|
||||
});
|
||||
|
||||
serverProcess.stderr?.on('data', (data) => {
|
||||
|
||||
Reference in New Issue
Block a user