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 }}

diff --git a/templates/admin/stats.html.twig b/templates/admin/stats.html.twig index 356ba03..061668e 100644 --- a/templates/admin/stats.html.twig +++ b/templates/admin/stats.html.twig @@ -131,37 +131,6 @@
-{% set followup_icons = { - 'fire_hydrant': 'bi-droplet', - 'charging_station': 'bi-lightning-charge', - 'toilets': 'bi-toilet', - 'bus_stop': 'bi-bus-front', - 'defibrillator': 'bi-heart-pulse', - 'camera': 'bi-camera-video', - 'recycling': 'bi-recycle', - 'substation': 'bi-plug', - 'laboratory': 'bi-beaker', - 'school': 'bi-mortarboard', - 'police': 'bi-shield-lock', - 'healthcare': 'bi-hospital', - 'places': 'bi-geo-alt' -} %} -{% set followup_labels = { - 'fire_hydrant': 'Bornes incendie', - 'charging_station': 'Bornes de recharge', - 'toilets': 'Toilettes publiques', - 'bus_stop': 'Arrêts de bus', - 'defibrillator': 'Défibrillateurs', - 'camera': 'Caméras de surveillance', - 'recycling': 'Points de recyclage', - 'substation': 'Sous-stations électriques', - 'laboratory': "Laboratoires d'analyse", - 'school': 'Écoles', - 'police': 'Commissariats', - 'healthcare': 'Lieux de santé', - 'places': 'Lieux' -} %} - {% set overpass_type_queries = { 'fire_hydrant': 'nwr["emergency"="fire_hydrant"](area.searchArea);', 'charging_station': 'nwr["amenity"="charging_station"](area.searchArea);',