From f1d23741191927bad4b99d49d2f8ce25e1fdb956 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 30 Jun 2025 15:26:32 +0200 Subject: [PATCH] up embed themes --- src/Service/FollowUpService.php | 13 +++++++- .../admin/followup_embed_graph.html.twig | 4 +-- templates/admin/stats.html.twig | 31 ------------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/Service/FollowUpService.php b/src/Service/FollowUpService.php index 44764e5..8e50aea 100644 --- a/src/Service/FollowUpService.php +++ b/src/Service/FollowUpService.php @@ -75,6 +75,7 @@ class FollowUpService ]; } $now = new \DateTime(); + $persisted = 0; foreach ($types as $type => $data) { // Suivi du nombre $followupCount = new CityFollowUp(); @@ -83,7 +84,11 @@ class FollowUpService ->setDate($now) ->setStats($stats); $em->persist($followupCount); - + $persisted++; + if ($persisted % 100 === 0) { + $em->flush(); + $em->clear(); + } // Suivi de la complétion personnalisé (exemples) $completed = []; @@ -198,8 +203,14 @@ class FollowUpService ->setDate($now) ->setStats($stats); $em->persist($followupCompletion); + $persisted++; + if ($persisted % 100 === 0) { + $em->flush(); + $em->clear(); + } } $em->flush(); + $em->clear(); } public function generateGlobalFollowUps(EntityManagerInterface $em): void diff --git a/templates/admin/followup_embed_graph.html.twig b/templates/admin/followup_embed_graph.html.twig index 9e834e0..66ba8a4 100644 --- a/templates/admin/followup_embed_graph.html.twig +++ b/templates/admin/followup_embed_graph.html.twig @@ -1,10 +1,10 @@ {% extends 'base_embed.html.twig' %} -{% block title %}Graphe thématique : {{ label }}{% endblock %} +{% block title %}Graphe thématique : {{ label }} - {{ stats.name }}{% endblock %} {% block body %}
-

{{ label }}

+

{{ label }} - {{ stats.name }}