Merge branch 'RED-8956' into 'master'

RED-8956: Fixed endless loop when flag calculation is required and file is deleted

Closes RED-8956

See merge request redactmanager/persistence-service!447
This commit is contained in:
Dominique Eifländer 2024-04-15 11:19:05 +02:00
commit 04759967e2

View File

@ -374,7 +374,8 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
select distinct f.id, f.dossierId
from FileEntity f
left join ViewedPageEntity v on f.id = v.file.id and v.id.userId = f.assignee
where (f.lastFlagCalculation is NULL and f.lastProcessed is not NULL) or f.lastManualChangeDate > f.lastFlagCalculation or f.lastProcessed > f.lastFlagCalculation or f.lastFlagCalculation < v.viewedTime
where f.deleted is NULL and f.hardDeletedTime is NULL
and ((f.lastFlagCalculation is NULL and f.lastProcessed is not NULL) or f.lastManualChangeDate > f.lastFlagCalculation or f.lastProcessed > f.lastFlagCalculation or f.lastFlagCalculation < v.viewedTime)
""")
List<Tuple> getFileIdentifiersWhereAnalysisFlagCalculationIsRequired();