Fix-messaging-calendar-issues (#11424)

- fixing Event Calendar bug due to TypeORM limitations
- avoid systematic crash on contact creation jobs, simply logging
This commit is contained in:
Guillim
2025-04-07 17:13:13 +02:00
committed by GitHub
parent 69da046812
commit 6451b7b5e3
2 changed files with 39 additions and 24 deletions

View File

@ -106,13 +106,18 @@ export class CalendarEventsImportService {
(event) => event.externalId,
);
await this.calendarSaveEventsService.saveCalendarEventsAndEnqueueContactCreationJob(
filteredEvents,
calendarChannel,
connectedAccount,
workspaceId,
);
const BATCH_SIZE = 1000;
for (let i = 0; i < filteredEvents.length; i = i + BATCH_SIZE) {
const eventsBatch = filteredEvents.slice(i, i + BATCH_SIZE);
await this.calendarSaveEventsService.saveCalendarEventsAndEnqueueContactCreationJob(
eventsBatch,
calendarChannel,
connectedAccount,
workspaceId,
);
}
const calendarChannelEventAssociationRepository =
await this.twentyORMManager.getRepository<CalendarChannelEventAssociationWorkspaceEntity>(
'calendarChannelEventAssociation',