diff --git a/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentRepository.java b/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentRepository.java index 24a405353..20ae354f7 100644 --- a/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentRepository.java +++ b/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentRepository.java @@ -3,6 +3,7 @@ import fr.dossierfacile.common.entity.Document; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.time.LocalDateTime; @@ -18,5 +19,5 @@ public interface DocumentRepository extends JpaRepository { AND watermark_file_id IS NULL LIMIT 100; """, nativeQuery = true) - List findToProcessWithoutPDFToDate(LocalDateTime toDateTime); + List findToProcessWithoutPDFToDate(@Param("to") LocalDateTime toDateTime); } diff --git a/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentToProcessTask.java b/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentToProcessTask.java index 0b61a0444..b45cfb5f4 100644 --- a/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentToProcessTask.java +++ b/dossierfacile-task-scheduler/src/main/java/fr/dossierfacile/scheduler/tasks/documenttoprocess/DocumentToProcessTask.java @@ -36,7 +36,7 @@ public class DocumentToProcessTask { public void launchFailedPDFGeneration() { LoggingContext.startTask(PDF_GENERATION); LocalDateTime now = LocalDateTime.now(); - LocalDateTime toDateTime = now.minusMinutes(10); + LocalDateTime toDateTime = now.minusMinutes(30); documentRepository.findToProcessWithoutPDFToDate(toDateTime).forEach(this::sendForPDFGeneration); LoggingContext.endTask(); } diff --git a/dossierfacile-task-scheduler/src/main/resources/application.properties b/dossierfacile-task-scheduler/src/main/resources/application.properties index ff4500640..52a4bda64 100644 --- a/dossierfacile-task-scheduler/src/main/resources/application.properties +++ b/dossierfacile-task-scheduler/src/main/resources/application.properties @@ -29,6 +29,8 @@ keycloak..server.url= # rabbitmq rabbitmq.exchange.file.process=exchange.file.process rabbitmq.routing.key.document.analyze=routing.key.document.analyze +rabbitmq.exchange.pdf.generator=exchange.pdf.generator +rabbitmq.routing.key.pdf.generator.watermark-document=routing.key.pdf.generator.watermark-document # email service sendinblue.apikey=