Update data management to use in-memory storage

Modify the application to use an in-memory storage solution, replacing the PostgreSQL database connection and data purging logic. This change impacts session management and data operations, introducing a fallback mechanism for when the database is unavailable.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: a388004f-01c5-42b1-b1d1-f18daf8bdd0c
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/a388004f-01c5-42b1-b1d1-f18daf8bdd0c/ekgWmFH
This commit is contained in:
michaelschal committed 2025-08-06 11:15:15 +00:00
1 parent 430ab669aa
commit 40c7975bbc
5 files changed
+323 -45

No files matched your search

+7 -11
View File
@@ -8,20 +8,16 @@ if (!process.env.DATABASE_URL) {
);
}
// Configuration de connexion avec SSL désactivé pour Docker local
// Configuration de connexion avec support Unix socket pour PostgreSQL local
const connectionConfig = {
connectionString: process.env.DATABASE_URL,
ssl: false // Désactiver SSL pour production Docker locale
user: process.env.PGUSER,
password: process.env.PGPASSWORD,
database: process.env.PGDATABASE,
host: '/home/runner/postgres_data/socket',
port: 5432,
ssl: false // Désactiver SSL pour PostgreSQL local
};
// Si DATABASE_URL contient déjà sslmode=disable, ne pas forcer SSL
if (process.env.DATABASE_URL?.includes('sslmode=disable')) {
connectionConfig.ssl = false;
} else if (process.env.NODE_ENV === 'production' && !process.env.DATABASE_URL?.includes('localhost')) {
// Activer SSL uniquement pour production externe (pas Docker local)
connectionConfig.ssl = { rejectUnauthorized: false };
}
export const pool = new Pool(connectionConfig);
export const db = drizzle(pool, { schema });