Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Try to run recursiveDelete in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGresse committed Apr 2, 2024
1 parent aba1569 commit 0f618e9
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions scripts/openplanner/import-speakers-sessions-schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,18 @@ async function deleteCollection(collectionPath: string, batchSize: number = 100)

const cleanupScheduleSessionSpeakers = async () => {
console.log('Cleaning up schedule sessions and speakers...');
try {
await Promise.all([
deleteCollection('generatedSchedule'),
deleteCollection('generatedSessions'),
deleteCollection('generatedSpeakers')
]);
} catch (error) {
console.error('Error cleaning up schedule sessions and speakers', error);
}
await Promise.all([
deleteCollection('schedule'),
deleteCollection('sessions'),
deleteCollection('speakers'),
deleteCollection('partners'),
deleteCollection('team')
deleteCollection('generatedSchedule'),
deleteCollection('generatedSessions'),
deleteCollection('generatedSpeakers')
]);
// await Promise.all([
// deleteCollection('schedule'),
// deleteCollection('sessions'),
// deleteCollection('speakers'),
// deleteCollection('partners'),
// deleteCollection('team')
// ]);
console.log('Cleanup done');
};

Expand Down

0 comments on commit 0f618e9

Please sign in to comment.