better logging errors in messages (#12136)

This commit is contained in:
Guillim
2025-05-20 13:37:24 +02:00
committed by GitHub
parent 0553f58c52
commit ad136b5246
19 changed files with 35 additions and 163 deletions
@@ -1,4 +1,4 @@
import { Logger, Scope } from '@nestjs/common';
import { Scope } from '@nestjs/common';
import { And, Any, ILike, In, Not, Or } from 'typeorm';
@@ -22,8 +22,6 @@ export type BlocklistItemDeleteMessagesJobData = WorkspaceEventBatch<
scope: Scope.REQUEST,
})
export class BlocklistItemDeleteMessagesJob {
private readonly logger = new Logger(BlocklistItemDeleteMessagesJob.name);
constructor(
private readonly threadCleanerService: MessagingMessageCleanerService,
private readonly twentyORMManager: TwentyORMManager,
@@ -81,12 +79,6 @@ export class BlocklistItemDeleteMessagesJob {
continue;
}
this.logger.log(
`Deleting messages from ${handles.join(
', ',
)} in workspace ${workspaceId} for workspace member ${workspaceMemberId}`,
);
const rolesToDelete: ('from' | 'to')[] = ['from', 'to'];
const messageChannels = await messageChannelRepository.find({
@@ -146,12 +138,6 @@ export class BlocklistItemDeleteMessagesJob {
messageChannelMessageAssociationsToDelete.map(({ id }) => id),
);
}
this.logger.log(
`Deleted messages from handle ${handles.join(
', ',
)} in workspace ${workspaceId} for workspace member ${workspaceMemberId}`,
);
}
await this.threadCleanerService.cleanWorkspaceThreads(workspaceId);