Skip to content

Commit

Permalink
fix: taskscheduler issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien committed Dec 18, 2023
1 parent 78dc99f commit 4aba539
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,5 +19,5 @@ public interface DocumentRepository extends JpaRepository<Document, Long> {
AND watermark_file_id IS NULL
LIMIT 100;
""", nativeQuery = true)
List<Document> findToProcessWithoutPDFToDate(LocalDateTime toDateTime);
List<Document> findToProcessWithoutPDFToDate(@Param("to") LocalDateTime toDateTime);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 4aba539

Please sign in to comment.