Update events in events.json in parallel rather than series

This commit is contained in:
Clarence Chan committed 2023-10-29 11:05:21 -04:00
1 parent cb8e32be66
commit 18aa02a074
1 file changed
+3 -1
+3 -1
View File
@@ -93,9 +93,11 @@ async function updateEventsFile() {
if (new Date(events[i].LiveEventDetail.StartTime) < Date.now()) continue; if (new Date(events[i].LiveEventDetail.StartTime) < Date.now()) continue;
console.log("Updating event", events[i].LiveEventDetail.EventId); console.log("Updating event", events[i].LiveEventDetail.EventId);
events[i] = await fetchEvent(events[i].LiveEventDetail.EventId); events[i] = fetchEvent(events[i].LiveEventDetail.EventId);
} }
events = await Promise.all(events);
// Starting from the latest event ID previously found, find and add any // Starting from the latest event ID previously found, find and add any
// new events // new events
let eventId = events[0].LiveEventDetail.EventId; let eventId = events[0].LiveEventDetail.EventId;