rename service

This commit is contained in:
2026-01-07 13:45:12 +01:00
parent c010f34479
commit ec0615f6df
3 changed files with 13 additions and 15 deletions
@@ -1,6 +1,6 @@
package SuMoC.backend.scheduling;
import SuMoC.backend.trenddetection.services.UpdateStatsTablesService;
import SuMoC.backend.trenddetection.services.StatTableUpdateService;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -17,14 +17,14 @@ public class ScheduledTasks {
private final SchedulingProperties properties;
private final UpdateStatsTablesService updateStatsTablesService;
private final StatTableUpdateService statTableUpdateService;
@Scheduled(cron = "#{@schedulingProperties.calculateWeeklyMobilityStats}")
public void scheduleCalculateWeeklyMobilityStats() {
logger.info("Scheduled task triggered: calculateWeeklyMobilityStatsForAllUsers");
try{
try {
LocalDate dayOfLastWeek = LocalDate.now().minusDays(7);
updateStatsTablesService.updateWeeklyMobilityStatsForAllUsers(dayOfLastWeek);
statTableUpdateService.updateWeeklyMobilityStatsForAllUsers(dayOfLastWeek);
} catch (Exception e) {
logger.error("Error calculating weekly mobility stats.", e);
}