lots of changes

This commit is contained in:
NoLogicAlan committed 2026-05-16 20:30:56 +03:00
1 parent ba225c914a
commit 6fa8f3b540
20 files changed
+296 -144

No files matched your search

+6
View File
@@ -1,5 +1,6 @@
import { compare, genSalt, hash } from "bcryptjs";
import { createPool } from "mysql2/promise";
import { logger } from "../constants/Logger.mjs";
/**
* DatabaseManager — MySQL pool for dashboard login codes and API tokens.
@@ -14,6 +15,11 @@ export class DatabaseManager {
connectionLimit: 15,
...config,
});
// Without this listener, unhandled pool-level errors (connection drops,
// timeouts) fire an unhandled 'error' event which crashes the process.
this.db.on("error", (err) => {
logger.error("[DashboardDB] MySQL pool error:", err.code ?? err.message);
});
}
/**