feat(sat): add scheduled cron job for daily sync (Phase 6)
- Add sat-sync.job.ts with scheduled daily sync at 3:00 AM - Automatic detection of tenants with active FIEL - Initial sync (10 years) for new tenants, daily for existing - Concurrent processing with configurable batch size - Integration with app startup for production environment - Install node-cron dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { app } from './app.js';
|
||||
import { env } from './config/env.js';
|
||||
import { startSatSyncJob } from './jobs/sat-sync.job.js';
|
||||
|
||||
const PORT = parseInt(env.PORT, 10);
|
||||
|
||||
app.listen(PORT, '0.0.0.0', () => {
|
||||
console.log(`🚀 API Server running on http://0.0.0.0:${PORT}`);
|
||||
console.log(`📊 Environment: ${env.NODE_ENV}`);
|
||||
console.log(`API Server running on http://0.0.0.0:${PORT}`);
|
||||
console.log(`Environment: ${env.NODE_ENV}`);
|
||||
|
||||
// Iniciar job de sincronización SAT
|
||||
if (env.NODE_ENV === 'production') {
|
||||
startSatSyncJob();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user