mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 15:32:10 +01:00
refactor: fix biome linting issues and update project documentation
- Fix 36+ biome linting issues reducing errors/warnings from 227 to 191 - Replace explicit 'any' types with proper TypeScript interfaces - Fix React hooks dependencies and useCallback patterns - Resolve unused variables and parameter assignment issues - Improve accessibility with proper label associations - Add comprehensive API documentation for admin and security features - Update README.md with accurate PostgreSQL setup and current tech stack - Create complete documentation for audit logging, CSP monitoring, and batch processing - Fix outdated project information and missing developer workflows
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
// Combined scheduler initialization with graceful shutdown
|
||||
|
||||
import { auditLogScheduler } from "./auditLogScheduler";
|
||||
import { prisma } from "./prisma";
|
||||
import { startProcessingScheduler } from "./processingScheduler";
|
||||
import { startCsvImportScheduler } from "./scheduler";
|
||||
@ -8,6 +9,7 @@ import { startCsvImportScheduler } from "./scheduler";
|
||||
* Initialize all schedulers
|
||||
* - CSV import scheduler (runs every 15 minutes)
|
||||
* - Session processing scheduler (runs every hour)
|
||||
* - Audit log retention scheduler (runs weekly by default)
|
||||
*/
|
||||
export function initializeSchedulers() {
|
||||
// Start the CSV import scheduler
|
||||
@ -16,6 +18,14 @@ export function initializeSchedulers() {
|
||||
// Start the session processing scheduler
|
||||
startProcessingScheduler();
|
||||
|
||||
// Start the audit log retention scheduler
|
||||
if (process.env.AUDIT_LOG_RETENTION_ENABLED !== "false") {
|
||||
auditLogScheduler.start();
|
||||
console.log("Audit log retention scheduler started");
|
||||
} else {
|
||||
console.log("Audit log retention scheduler disabled");
|
||||
}
|
||||
|
||||
console.log("All schedulers initialized successfully");
|
||||
|
||||
// Set up graceful shutdown for schedulers
|
||||
@ -30,6 +40,10 @@ function setupGracefulShutdown() {
|
||||
console.log(`\nReceived ${signal}. Starting graceful shutdown...`);
|
||||
|
||||
try {
|
||||
// Stop the audit log scheduler
|
||||
auditLogScheduler.stop();
|
||||
console.log("Audit log scheduler stopped.");
|
||||
|
||||
// Disconnect from database
|
||||
await prisma.$disconnect();
|
||||
console.log("Database connections closed.");
|
||||
|
||||
Reference in New Issue
Block a user