CsdnSchedule.java 646 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11
package com.kwan.springbootkwan.schedule;


import com.kwan.springbootkwan.service.CsdnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Slf4j
12
@Component
13 14 15 16 17
public class CsdnSchedule {

    @Autowired
    private CsdnService csdnService;

18
    @Scheduled(cron = "0 0 6,8,10,12,14,16,18,20,22 * * ?")
19 20 21 22 23 24 25
    public void execute() {
        log.info("Scheduled task is running ... ...");
        csdnService.multiTriplet();
        log.info("Scheduled task is finish ... ...");
    }
}