Compare commits

...
Author SHA1 Message Date
EtienneandCharles Bochet 0a75cbd06c clean not found file - add logs (#12198) 2025-05-22 11:40:20 +02:00
Charles BochetandCharles Bochet 3e731da69c Fix docker setup (#12209)
For fresh install, we need the migrations to happen before the upgrade
command is triggered as the upgrade command is a NestJS command and the
app will try to load env variables from db
2025-05-22 11:32:26 +02:00
2 changed files with 8 additions and 0 deletions
@@ -22,6 +22,7 @@ setup_and_migrate_db() {
# Run setup and migration scripts
NODE_OPTIONS="--max-old-space-size=1500" tsx ./scripts/setup-db.ts
yarn database:migrate:prod
fi
yarn command:prod upgrade
@@ -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,