From 971bda00121c17826e28298d7cca78eda5252c41 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Sun, 17 Aug 2025 16:12:44 +0000 Subject: [PATCH] Restore database connection for production environment Fix issue in server/storage.ts where DatabaseStorage was not being used in production, causing database connection errors. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/6kmwY2j --- cookies.txt | 2 +- server/storage.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cookies.txt b/cookies.txt index f442c0e..5b77c66 100644 --- a/cookies.txt +++ b/cookies.txt @@ -2,4 +2,4 @@ # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -#HttpOnly_localhost FALSE / FALSE 1755533276 connect.sid s%3AeSuU-8Im6I46mIPMKRDM-0aPCdhWTzSL.7GTr5iIPSvj6vp5hpsbHQAs979W057UO9Lr3uRDpJ3I +#HttpOnly_localhost FALSE / FALSE 1755533549 connect.sid s%3AGRBodJanN_-I3rKEedKB2fTigAi5MCxd.DwfSaA4EL79Luvbib4T399slEhtQV%2Fw%2FbjUwjRGRU3g diff --git a/server/storage.ts b/server/storage.ts index a976228..fba8d01 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -3401,8 +3401,7 @@ console.log('🔗 Database initialization:', { dbHost: process.env.DATABASE_URL?.split('@')[1]?.split('/')[0] || 'unknown' }); -// TEMPORARY: Force MemStorage for cache testing -export const storage: IStorage = new MemStorage(); +export const storage: IStorage = isProduction ? new DatabaseStorage() : new MemStorage(); if (isProduction) { console.log('✅ Using DatabaseStorage (production PostgreSQL)'); } else {