| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Optional; |
| | |
| | | * Created by vincent on 5/8/2024 |
| | | */ |
| | | @Slf4j |
| | | //@Component |
| | | @Component |
| | | @SuppressWarnings("all") |
| | | public class LogDataScheduler { |
| | | |
| | |
| | | @Transactional |
| | | public void syncLog() { |
| | | Integer dataExpiredDays = Optional.ofNullable(configService.getVal("dataExpiredDays", Integer.class)).orElse(7); |
| | | this.syncTaskLog(dataExpiredDays); |
| | | this.syncActionLog(dataExpiredDays); |
| | | this.syncSegmentLog(dataExpiredDays); |
| | | this.syncJamLog(dataExpiredDays); |
| | | this.syncTravelLog(dataExpiredDays); |
| | | if (dataExpiredDays > 0) { |
| | | this.syncTaskLog(dataExpiredDays); |
| | | this.syncActionLog(dataExpiredDays); |
| | | this.syncSegmentLog(dataExpiredDays); |
| | | this.syncJamLog(dataExpiredDays); |
| | | this.syncTravelLog(dataExpiredDays); |
| | | } |
| | | } |
| | | |
| | | public void syncTaskLog(Integer dataExpiredDays){ |