MrShi
2 天以前 7ee466ebc953bb5640bcf42f2b8e2a87aa471c21
server/admin/src/main/java/com/doumee/core/job/SchedulerProxy.java
@@ -3,11 +3,14 @@
import com.doumee.config.quartz.JobHandler;
import com.doumee.config.quartz.JobHandlerWithDisallowConcurrent;
import com.doumee.core.constants.Constants;
import com.doumee.service.business.AreasService;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
@@ -17,11 +20,20 @@
 */
@Slf4j
@Component
@EnableScheduling
public class SchedulerProxy {
    @Autowired
    private Scheduler scheduler;
    @Autowired
    private AreasService areasService;
    @Scheduled(initialDelay = 0, fixedRate = 10000)
    public void cacheAreaData(){
        areasService.cacheData();
    }
    /**
     * 创建JOB
     *