Fix assert unreachable, remove unused variables (#13753)
Small code cleanup
This commit is contained in:
+1
-5
@@ -1,4 +1,4 @@
|
||||
import { Logger, Scope } from '@nestjs/common';
|
||||
import { Scope } from '@nestjs/common';
|
||||
|
||||
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
|
||||
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
|
||||
@@ -15,10 +15,6 @@ export type MessagingConnectedAccountDeletionCleanupJobData = {
|
||||
scope: Scope.REQUEST,
|
||||
})
|
||||
export class MessagingConnectedAccountDeletionCleanupJob {
|
||||
private readonly logger = new Logger(
|
||||
MessagingConnectedAccountDeletionCleanupJob.name,
|
||||
);
|
||||
|
||||
constructor(
|
||||
private readonly messageCleanerService: MessagingMessageCleanerService,
|
||||
) {}
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { type ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
|
||||
import {
|
||||
@@ -12,7 +12,6 @@ import { isAccessTokenRefreshingError } from 'src/modules/messaging/message-impo
|
||||
|
||||
@Injectable()
|
||||
export class MicrosoftFetchByBatchService {
|
||||
private readonly logger = new Logger(MicrosoftFetchByBatchService.name);
|
||||
constructor(
|
||||
private readonly microsoftClientProvider: MicrosoftClientProvider,
|
||||
private readonly microsoftHandleErrorService: MicrosoftHandleErrorService,
|
||||
@@ -89,7 +88,7 @@ export class MicrosoftFetchByBatchService {
|
||||
* }
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private isTemporaryError(error: any): boolean {
|
||||
private _isTemporaryError(error: any): boolean {
|
||||
return error?.body?.includes('Unexpected token < in JSON at position');
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -8,7 +8,6 @@ import { TwentyORMManager } from 'src/engine/twenty-orm/twenty-orm.manager';
|
||||
import { BlocklistRepository } from 'src/modules/blocklist/repositories/blocklist.repository';
|
||||
import { BlocklistWorkspaceEntity } from 'src/modules/blocklist/standard-objects/blocklist.workspace-entity';
|
||||
import { EmailAliasManagerService } from 'src/modules/connected-account/email-alias-manager/services/email-alias-manager.service';
|
||||
import { ConnectedAccountRefreshTokensService } from 'src/modules/connected-account/refresh-tokens-manager/services/connected-account-refresh-tokens.service';
|
||||
import { type ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/standard-objects/connected-account.workspace-entity';
|
||||
import { MessageChannelSyncStatusService } from 'src/modules/messaging/common/services/message-channel-sync-status.service';
|
||||
import {
|
||||
@@ -34,7 +33,6 @@ export class MessagingMessagesImportService {
|
||||
private readonly cacheStorage: CacheStorageService,
|
||||
private readonly messageChannelSyncStatusService: MessageChannelSyncStatusService,
|
||||
private readonly saveMessagesAndEnqueueContactCreationService: MessagingSaveMessagesAndEnqueueContactCreationService,
|
||||
private readonly connectedAccountRefreshTokensService: ConnectedAccountRefreshTokensService,
|
||||
private readonly messagingMonitoringService: MessagingMonitoringService,
|
||||
@InjectObjectMetadataRepository(BlocklistWorkspaceEntity)
|
||||
private readonly blocklistRepository: BlocklistRepository,
|
||||
|
||||
-5
@@ -1,4 +1,3 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
|
||||
import snakeCase from 'lodash.snakecase';
|
||||
@@ -20,10 +19,6 @@ export const MESSAGING_MESSAGE_CHANNEL_SYNC_STATUS_MONITORING_CRON_PATTERN =
|
||||
|
||||
@Processor(MessageQueue.cronQueue)
|
||||
export class MessagingMessageChannelSyncStatusMonitoringCronJob {
|
||||
private readonly logger = new Logger(
|
||||
MessagingMessageChannelSyncStatusMonitoringCronJob.name,
|
||||
);
|
||||
|
||||
constructor(
|
||||
@InjectRepository(Workspace, 'core')
|
||||
private readonly workspaceRepository: Repository<Workspace>,
|
||||
|
||||
+7
-14
@@ -13,23 +13,16 @@ type MessagingMonitoringTrackInput = {
|
||||
|
||||
@Injectable()
|
||||
export class MessagingMonitoringService {
|
||||
constructor(private readonly auditService: AuditService) {}
|
||||
constructor(private readonly _auditService: AuditService) {}
|
||||
|
||||
public async track({
|
||||
eventName,
|
||||
workspaceId,
|
||||
userId,
|
||||
connectedAccountId,
|
||||
messageChannelId,
|
||||
message,
|
||||
eventName: _eventName,
|
||||
workspaceId: _workspaceId,
|
||||
userId: _userId,
|
||||
connectedAccountId: _connectedAccountId,
|
||||
messageChannelId: _messageChannelId,
|
||||
message: _message,
|
||||
}: MessagingMonitoringTrackInput): Promise<void> {
|
||||
const _eventName = eventName;
|
||||
const _workspaceId = workspaceId;
|
||||
const _userId = userId;
|
||||
const _connectedAccountId = connectedAccountId;
|
||||
const _messageChannelId = messageChannelId;
|
||||
const _message = message;
|
||||
|
||||
// TODO: replace once we have Prometheus
|
||||
/*
|
||||
await this.auditService
|
||||
|
||||
Reference in New Issue
Block a user