forked from ryanmwangi/CalMerger
update cron job to use mergedCalendar.id when calling the updateMergedCalendars function
This commit is contained in:
parent
77f19504a2
commit
c6117e3470
|
@ -241,7 +241,10 @@ app.post('/refresh/:id', async (req, res) => {
|
|||
// Schedule a cron job to update the merged calendar every hour
|
||||
cron.schedule('1 * * * *', () => {
|
||||
console.log('Updating merged calendar...');
|
||||
updateMergedCalendars();
|
||||
const calendarsData = JSON.parse(fs.readFileSync(CALENDARS_FILE, 'utf8'));
|
||||
calendarsData.mergedCalendars.forEach((mergedCalendar) => {
|
||||
updateMergedCalendars(mergedCalendar.id);
|
||||
});
|
||||
});
|
||||
|
||||
// Start the server
|
||||
|
|
Loading…
Reference in New Issue