廖井涛
4 天以前 cf4b24b7757bc76bb9c01fe936140073cb150711
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.example.erp.scheduling;
 
import com.example.erp.service.pp.ReportingWorkService;
import lombok.RequiredArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
@Component
@RequiredArgsConstructor
public class ScheduledTasks {
    private final ReportingWorkService reportingWorkService;
 
    @Scheduled( fixedRate = 2*60*1000)
    public void reportingWorkRedisToMysql() throws InterruptedException {
        reportingWorkService.redisToMysqlReportingWork();
    }
}