14 lines
337 B
TypeScript
14 lines
337 B
TypeScript
import cron from 'node-cron';
|
|
import { syncAllDomains } from './sync';
|
|
|
|
console.log('Starting Cron Job for S3 Sync...');
|
|
|
|
cron.schedule('0 * * * *', async () => {
|
|
console.log('Running Sync...');
|
|
try {
|
|
await syncAllDomains();
|
|
console.log('Sync completed.');
|
|
} catch (error) {
|
|
console.error('Sync error:', error);
|
|
}
|
|
}); |