From fbfe0c6045bc14d8dc9828ca259551e852e2e9a7 Mon Sep 17 00:00:00 2001 From: Stefano Ricci <1219739+SteRiccio@users.noreply.github.com> Date: Wed, 8 May 2024 15:55:59 +0200 Subject: [PATCH] fixed files import job (#3418) Co-authored-by: Stefano Ricci --- .../arenaImport/service/arenaImport/jobs/filesImportJob.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js b/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js index 0d846bad1c..d3024594c6 100644 --- a/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js +++ b/server/modules/arenaImport/service/arenaImport/jobs/filesImportJob.js @@ -139,6 +139,9 @@ export default class FilesImportJob extends Job { async deleteOrphanFiles() { const { context, tx } = this const { dryRun, filesToDeleteByUuid, updatedFilesByUuid, surveyId } = context + + if (Objects.isEmpty(filesToDeleteByUuid)) return + const filesToDeleteArray = Object.values(filesToDeleteByUuid) for await (const file of filesToDeleteArray) { const fileUuid = RecordFile.getUuid(file)