@ -10,9 +10,9 @@ import { SaveOrUpdateConnectedAccountInput } from 'src/engine/core-modules/auth/
|
||||
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
|
||||
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';
|
||||
import {
|
||||
GoogleCalendarFullSyncJob,
|
||||
GoogleCalendarFullSyncJobData,
|
||||
} from 'src/modules/calendar/jobs/google-calendar-full-sync.job';
|
||||
GoogleCalendarSyncJob,
|
||||
GoogleCalendarSyncJobData,
|
||||
} from 'src/modules/calendar/jobs/google-calendar-sync.job';
|
||||
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
|
||||
import {
|
||||
FeatureFlagEntity,
|
||||
@ -135,10 +135,7 @@ export class GoogleAPIsService {
|
||||
this.environmentService.get('CALENDAR_PROVIDER_GOOGLE_ENABLED') &&
|
||||
IsCalendarEnabled
|
||||
) {
|
||||
await this.enqueueGoogleCalendarFullSyncJob(
|
||||
workspaceId,
|
||||
connectedAccountId,
|
||||
);
|
||||
await this.enqueueGoogleCalendarSyncJob(workspaceId, connectedAccountId);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -170,10 +167,7 @@ export class GoogleAPIsService {
|
||||
}
|
||||
|
||||
if (this.environmentService.get('CALENDAR_PROVIDER_GOOGLE_ENABLED')) {
|
||||
await this.enqueueGoogleCalendarFullSyncJob(
|
||||
workspaceId,
|
||||
connectedAccountId,
|
||||
);
|
||||
await this.enqueueGoogleCalendarSyncJob(workspaceId, connectedAccountId);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -192,12 +186,12 @@ export class GoogleAPIsService {
|
||||
);
|
||||
}
|
||||
|
||||
async enqueueGoogleCalendarFullSyncJob(
|
||||
async enqueueGoogleCalendarSyncJob(
|
||||
workspaceId: string,
|
||||
connectedAccountId: string,
|
||||
) {
|
||||
await this.calendarQueueService.add<GoogleCalendarFullSyncJobData>(
|
||||
GoogleCalendarFullSyncJob.name,
|
||||
await this.calendarQueueService.add<GoogleCalendarSyncJobData>(
|
||||
GoogleCalendarSyncJob.name,
|
||||
{
|
||||
workspaceId,
|
||||
connectedAccountId,
|
||||
|
||||
@ -28,12 +28,11 @@ import { StripeModule } from 'src/engine/core-modules/billing/stripe/stripe.modu
|
||||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
||||
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
|
||||
import { GoogleCalendarFullSyncJob } from 'src/modules/calendar/jobs/google-calendar-full-sync.job';
|
||||
import { GoogleCalendarSyncJob } from 'src/modules/calendar/jobs/google-calendar-sync.job';
|
||||
import { CalendarEventCleanerModule } from 'src/modules/calendar/services/calendar-event-cleaner/calendar-event-cleaner.module';
|
||||
import { RecordPositionBackfillJob } from 'src/engine/api/graphql/workspace-query-runner/jobs/record-position-backfill.job';
|
||||
import { RecordPositionBackfillModule } from 'src/engine/api/graphql/workspace-query-runner/services/record-position-backfill-module';
|
||||
import { DeleteConnectedAccountAssociatedCalendarDataJob } from 'src/modules/calendar/jobs/delete-connected-account-associated-calendar-data.job';
|
||||
import { GoogleCalendarFullSyncModule } from 'src/modules/calendar/services/google-calendar-full-sync.module';
|
||||
import { GoogleCalendarSyncModule } from 'src/modules/calendar/services/google-calendar-sync.module';
|
||||
import { GoogleAPIRefreshAccessTokenModule } from 'src/modules/connected-account/services/google-api-refresh-access-token/google-api-refresh-access-token.module';
|
||||
import { MessageParticipantModule } from 'src/modules/messaging/services/message-participant/message-participant.module';
|
||||
import { ObjectMetadataRepositoryModule } from 'src/engine/object-metadata-repository/object-metadata-repository.module';
|
||||
@ -45,12 +44,14 @@ import { EventObjectMetadata } from 'src/modules/event/standard-objects/event.ob
|
||||
import { HandleWorkspaceMemberDeletedJob } from 'src/engine/core-modules/workspace/handle-workspace-member-deleted.job';
|
||||
import { GmailFullSynV2Module } from 'src/modules/messaging/services/gmail-full-sync-v2/gmail-full-sync.v2.module';
|
||||
import { GmailFetchMessageContentFromCacheModule } from 'src/modules/messaging/services/gmail-fetch-message-content-from-cache/gmail-fetch-message-content-from-cache.module';
|
||||
import { FetchAllMessagesFromCacheCronJob } from 'src/modules/messaging/jobs/crons/fetch-all-messages-from-cache.cron.job';
|
||||
import { GmailFullSyncV2Job } from 'src/modules/messaging/jobs/gmail-full-sync-v2.job';
|
||||
import { GmailPartialSyncV2Job } from 'src/modules/messaging/jobs/gmail-partial-sync-v2.job';
|
||||
import { GmailPartialSyncV2Module } from 'src/modules/messaging/services/gmail-partial-sync-v2/gmail-partial-sync-v2.module';
|
||||
import { GoogleCalendarSyncCronJob } from 'src/modules/calendar/jobs/crons/google-calendar-sync.cron.job';
|
||||
import { CalendarEventParticipantModule } from 'src/modules/calendar/services/calendar-event-participant/calendar-event-participant.module';
|
||||
import { UnmatchParticipantJob } from 'src/modules/connected-account/jobs/unmatch-participant.job';
|
||||
import { DeleteConnectedAccountAssociatedCalendarDataJob } from 'src/modules/calendar/jobs/delete-connected-account-associated-calendar-data.job';
|
||||
import { FetchAllMessagesFromCacheCronJob } from 'src/modules/messaging/jobs/crons/fetch-all-messages-from-cache.cron.job';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@ -60,7 +61,7 @@ import { UnmatchParticipantJob } from 'src/modules/connected-account/jobs/unmatc
|
||||
DataSeedDemoWorkspaceModule,
|
||||
EnvironmentModule,
|
||||
HttpModule,
|
||||
GoogleCalendarFullSyncModule,
|
||||
GoogleCalendarSyncModule,
|
||||
ObjectMetadataModule,
|
||||
StripeModule,
|
||||
ThreadCleanerModule,
|
||||
@ -86,8 +87,8 @@ import { UnmatchParticipantJob } from 'src/modules/connected-account/jobs/unmatc
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: GoogleCalendarFullSyncJob.name,
|
||||
useClass: GoogleCalendarFullSyncJob,
|
||||
provide: GoogleCalendarSyncJob.name,
|
||||
useClass: GoogleCalendarSyncJob,
|
||||
},
|
||||
{
|
||||
provide: CallWebhookJobsJob.name,
|
||||
@ -159,6 +160,10 @@ import { UnmatchParticipantJob } from 'src/modules/connected-account/jobs/unmatc
|
||||
provide: GmailPartialSyncV2Job.name,
|
||||
useClass: GmailPartialSyncV2Job,
|
||||
},
|
||||
{
|
||||
provide: GoogleCalendarSyncCronJob.name,
|
||||
useClass: GoogleCalendarSyncCronJob,
|
||||
},
|
||||
],
|
||||
})
|
||||
export class JobsModule {
|
||||
|
||||
Reference in New Issue
Block a user