feat: Add cron job for audit logs cleanup
- Add cleanupAuditLogs.js with daily cleanup job - Delete audit logs older than 7 days - Runs every day at midnight (00:00) - Export cleanupOldAuditLogs for manual triggers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { logger } from '../utils/logger.js';
|
||||
import { startCalendarNotificationCron, triggerEventNotifications, triggerSingleEventNotification } from './calendar/index.js';
|
||||
import { startAuditCleanupCron, cleanupOldAuditLogs } from './cleanupAuditLogs.js';
|
||||
|
||||
/**
|
||||
* Start all cron jobs
|
||||
@@ -10,8 +11,11 @@ export const startAllCronJobs = () => {
|
||||
// Calendar event notifications
|
||||
startCalendarNotificationCron();
|
||||
|
||||
// Audit logs cleanup (daily at midnight)
|
||||
startAuditCleanupCron();
|
||||
|
||||
logger.info('=== Všetky cron jobs inicializované ===');
|
||||
};
|
||||
|
||||
// Export individual functions for testing/manual triggers
|
||||
export { triggerEventNotifications, triggerSingleEventNotification };
|
||||
export { triggerEventNotifications, triggerSingleEventNotification, cleanupOldAuditLogs };
|
||||
|
||||
Reference in New Issue
Block a user