From 786ad088b3c175a4e5e077d75a531d5074dd2c9c Mon Sep 17 00:00:00 2001 From: Etienne <45695613+etiennejouan@users.noreply.github.com> Date: Wed, 21 May 2025 23:56:02 +0200 Subject: [PATCH] clean not found file - add logs (#12198) --- .../0-54/0-54-clean-not-found-files.command.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/0-54/0-54-clean-not-found-files.command.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/0-54/0-54-clean-not-found-files.command.ts index cf31615b8..955c39a18 100644 --- a/packages/twenty-server/src/database/commands/upgrade-version-command/0-54/0-54-clean-not-found-files.command.ts +++ b/packages/twenty-server/src/database/commands/upgrade-version-command/0-54/0-54-clean-not-found-files.command.ts @@ -86,6 +86,8 @@ export class CleanNotFoundFilesCommand extends ActiveOrSuspendedWorkspacesMigrat if (!isNonEmptyString(workspace.logo)) return; + this.logger.log('Processing workspace logo for workspace', workspace.id); + const isFileFound = await this.checkIfFileIsFound( workspace.logo, workspace.id, @@ -122,6 +124,7 @@ export class CleanNotFoundFilesCommand extends ActiveOrSuspendedWorkspacesMigrat const attachmentIdsToSoftDeleteChunk = await Promise.all( attachmentsChunk.map(async (attachment) => { + this.logger.log('Processing attachment', attachment.id); const isFileFound = await this.checkIfFileIsFound( attachment.fullPath, workspaceId, @@ -164,6 +167,8 @@ export class CleanNotFoundFilesCommand extends ActiveOrSuspendedWorkspacesMigrat const workspaceMemberIdsToUpdate: string[] = []; for (const workspaceMember of workspaceMembers) { + this.logger.log('Processing workspaceMember', workspaceMember.id); + const isFileFound = await this.checkIfFileIsFound( workspaceMember.avatarUrl, workspaceId, @@ -201,6 +206,8 @@ export class CleanNotFoundFilesCommand extends ActiveOrSuspendedWorkspacesMigrat const personIdsToUpdate: string[] = []; for (const person of people) { + this.logger.log('Processing person', person.id); + const isFileFound = await this.checkIfFileIsFound( person.avatarUrl, workspaceId,