rename service
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user