docs verzeichnis und .env.local in Gitea speichern

This commit is contained in:
ISA
2025-05-15 10:47:10 +02:00
parent c2ffec7fd3
commit 7c67111ccd
23 changed files with 161 additions and 51 deletions

View File

@@ -16,23 +16,34 @@ function getPool() {
waitForConnections: true,
queueLimit: 10, // Warteschlangenlimit für Verbindungen
connectTimeout: 5000, // Timeout für Verbindungsversuche (5 Sekunden)
acquireTimeout: 10000, // Timeout für Verbindungsanforderungen aus dem Pool (10 Sekunden)
//acquireTimeout: 10000, // Timeout für Verbindungsanforderungen aus dem Pool (10 Sekunden)
idleTimeout: 60000, // 1 Minute
});
// Ereignisse für das Protokollieren der Verbindungsstatistiken
let maxUsed = 0;
cachedPool.on("acquire", () => {
connectionCount++;
console.log(`[ACQUIRE] Active connections: ${connectionCount}`);
if (process.env.NODE_ENV === "development") {
console.log("\x1b[36m%s\x1b[0m", ` Connection acquired (${connectionCount} total)`);
if (connectionCount > maxUsed) {
maxUsed = connectionCount;
console.log(`📈 Neue Höchstzahl aktiver gleichzeitiger Verbindungen: ${maxUsed}`);
}
}
});
cachedPool.on("release", () => {
connectionCount--;
console.log(`[RELEASE] Active connections: ${connectionCount}`);
if (process.env.NODE_ENV === "development") {
console.log("\x1b[32m%s\x1b[0m", ` Connection released (${connectionCount} total)`);
}
});
cachedPool.on("enqueue", () => {
console.log(`[ENQUEUE] Waiting for available connection slot.`);
if (process.env.NODE_ENV === "development") {
console.warn("\x1b[33m%s\x1b[0m", "⏳ Pool voll Anfrage in Warteschlange");
}
});
}