Skip to content

Commit

Permalink
fix: rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
magrinj committed Jun 6, 2024
1 parent f57579c commit cadb059
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Inject } from '@nestjs/common';

import { Command, CommandRunner, Option } from 'nest-commander';

import {
RecordPositionBackfillJob,
RecordPositionBackfillJobData,
} from 'src/engine/api/graphql/workspace-query-runner/jobs/record-position-backfill.job';
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/engine/integrations/message-queue/services/message-queue.service';

Expand All @@ -20,7 +19,7 @@ export type RecordPositionBackfillCommandOptions = {
})
export class RecordPositionBackfillCommand extends CommandRunner {
constructor(
@Inject(MessageQueue.recordPositionBackfillQueue)
@InjectMessageQueue(MessageQueue.recordPositionBackfillQueue)
private readonly messageQueueService: MessageQueueService,
) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ import { CreateCompanyAndContactJob } from 'src/modules/connected-account/auto-c

@Module({
imports: [AutoCompaniesAndContactsCreationModule],
providers: [
{
provide: CreateCompanyAndContactJob.name,
useClass: CreateCompanyAndContactJob,
},
],
providers: [CreateCompanyAndContactJob],
})
export class AutoCompaniesAndContactsCreationJobModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import { MessagingMessageCleanerService } from 'src/modules/messaging/message-cl
],
providers: [
MessagingMessageCleanerService,
{
provide: MessagingConnectedAccountDeletionCleanupJob.name,
useClass: MessagingConnectedAccountDeletionCleanupJob,
},
MessagingConnectedAccountDeletionCleanupJob,
MessagingMessageCleanerConnectedAccountListener,
],
exports: [MessagingMessageCleanerService],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Inject, Injectable, Logger } from '@nestjs/common';
import { Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';

import { Repository, In } from 'typeorm';

import { MessageQueueJob } from 'src/engine/integrations/message-queue/interfaces/message-queue-job.interface';

import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { DataSourceEntity } from 'src/engine/metadata-modules/data-source/data-source.entity';
import { EnvironmentService } from 'src/engine/integrations/environment/environment.service';
Expand All @@ -14,11 +12,12 @@ import {
MessagingMessagesImportJobData,
MessagingMessagesImportJob,
} from 'src/modules/messaging/message-import-manager/jobs/messaging-messages-import.job';
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
import { InjectMessageQueue } from 'src/engine/integrations/message-queue/decorators/message-queue.decorator';

@Injectable()
export class MessagingMessagesImportCronJob
implements MessageQueueJob<undefined>
{
@Processor(MessageQueue.cronQueue)
export class MessagingMessagesImportCronJob {
private readonly logger = new Logger(MessagingMessagesImportCronJob.name);

constructor(
Expand All @@ -27,10 +26,11 @@ export class MessagingMessagesImportCronJob
@InjectRepository(DataSourceEntity, 'metadata')
private readonly dataSourceRepository: Repository<DataSourceEntity>,
private readonly environmentService: EnvironmentService,
@Inject(MessageQueue.messagingQueue)
@InjectMessageQueue(MessageQueue.messagingQueue)
private readonly messageQueueService: MessageQueueService,
) {}

@Process()
async handle(): Promise<void> {
const workspaceIds = (
await this.workspaceRepository.find({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Injectable, Logger } from '@nestjs/common';

import { MessageQueueJob } from 'src/engine/integrations/message-queue/interfaces/message-queue-job.interface';
import { Logger } from '@nestjs/common';

import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
import { InjectObjectMetadataRepository } from 'src/engine/object-metadata-repository/object-metadata-repository.decorator';
import { ConnectedAccountRepository } from 'src/modules/connected-account/repositories/connected-account.repository';
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
Expand All @@ -20,10 +21,8 @@ export type MessagingMessageListFetchJobData = {
connectedAccountId: string;
};

@Injectable()
export class MessagingMessageListFetchJob
implements MessageQueueJob<MessagingMessageListFetchJobData>
{
@Processor(MessageQueue.messagingQueue)
export class MessagingMessageListFetchJob {
private readonly logger = new Logger(MessagingMessageListFetchJob.name);

constructor(
Expand All @@ -36,6 +35,7 @@ export class MessagingMessageListFetchJob
private readonly messagingTelemetryService: MessagingTelemetryService,
) {}

@Process()
async handle(data: MessagingMessageListFetchJobData): Promise<void> {
const { workspaceId, connectedAccountId } = data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Injectable } from '@nestjs/common';

import { MessageQueueJob } from 'src/engine/integrations/message-queue/interfaces/message-queue-job.interface';

import { Process } from 'src/engine/integrations/message-queue/decorators/process.decorator';
import { Processor } from 'src/engine/integrations/message-queue/decorators/processor.decorator';
import { MessageQueue } from 'src/engine/integrations/message-queue/message-queue.constants';
import { InjectObjectMetadataRepository } from 'src/engine/object-metadata-repository/object-metadata-repository.decorator';
import { ConnectedAccountRepository } from 'src/modules/connected-account/repositories/connected-account.repository';
import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
Expand All @@ -15,10 +14,8 @@ export type MessagingMessagesImportJobData = {
workspaceId: string;
};

@Injectable()
export class MessagingMessagesImportJob
implements MessageQueueJob<MessagingMessagesImportJobData>
{
@Processor(MessageQueue.messagingQueue)
export class MessagingMessagesImportJob {
constructor(
@InjectObjectMetadataRepository(ConnectedAccountWorkspaceEntity)
private readonly connectedAccountRepository: ConnectedAccountRepository,
Expand All @@ -28,6 +25,7 @@ export class MessagingMessagesImportJob
private readonly messagingTelemetryService: MessagingTelemetryService,
) {}

@Process()
async handle(data: MessagingMessagesImportJobData): Promise<void> {
const { workspaceId } = data;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,10 @@ import { MessagingMessagesImportJob } from 'src/modules/messaging/message-import
providers: [
MessagingMessageListFetchCronCommand,
MessagingMessagesImportCronCommand,
{
provide: MessagingMessageListFetchJob.name,
useClass: MessagingMessageListFetchJob,
},
{
provide: MessagingMessagesImportJob.name,
useClass: MessagingMessagesImportJob,
},
{
provide: MessagingMessageListFetchCronJob.name,
useClass: MessagingMessageListFetchCronJob,
},
{
provide: MessagingMessagesImportCronJob.name,
useClass: MessagingMessagesImportCronJob,
},
MessagingMessageListFetchJob,
MessagingMessagesImportJob,
MessagingMessageListFetchCronJob,
MessagingMessagesImportCronJob,
],
exports: [],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ import { MessagingCreateCompanyAndContactAfterSyncJob } from 'src/modules/messag
MessagingGmailDriverModule,
AutoCompaniesAndContactsCreationModule,
],
providers: [
{
provide: MessagingCreateCompanyAndContactAfterSyncJob.name,
useClass: MessagingCreateCompanyAndContactAfterSyncJob,
},
],
providers: [MessagingCreateCompanyAndContactAfterSyncJob],
})
export class MessaginParticipantsManagerModule {}

0 comments on commit cadb059

Please sign in to comment.