mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-20 05:28:22 +02:00
Configure production database connection for increased reliability
Updates the server-side database configuration to use standard PostgreSQL for production environments, ensuring a more robust and reliable connection. Previously, it might have defaulted to a different setup or encountered connection issues. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d396e5bd-e32d-4a20-9e7d-71e7102ddc6c Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d396e5bd-e32d-4a20-9e7d-71e7102ddc6c/CrwFq15
This commit is contained in:
1 parent
2aecaa2672
commit
22a6c5d7f6
6 files changed
+305
-15
No files matched your search
+6
-3
@@ -1963,6 +1963,9 @@ class MemStorage implements IStorage {
|
||||
}
|
||||
|
||||
// Use MemStorage in development, DatabaseStorage in production
|
||||
const isProduction = process.env.NODE_ENV === 'production' && process.env.DATABASE_URL;
|
||||
export const storage = isProduction ? new DatabaseStorage() : new MemStorage();
|
||||
console.log(isProduction ? '🐳 PRODUCTION: Using PostgreSQL storage' : '🔧 DEV: Using in-memory storage');
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
const dbUrl = process.env.DATABASE_URL;
|
||||
const isProductionDocker = isProduction && dbUrl && (dbUrl.includes('logiflow-db') || dbUrl.includes('localhost'));
|
||||
|
||||
export const storage = isProductionDocker ? new DatabaseStorage() : new MemStorage();
|
||||
console.log(isProductionDocker ? '🐳 PRODUCTION: Using PostgreSQL storage' : '🔧 DEV: Using in-memory storage');
|
||||
Reference in new issue
Block a user