package com.microservices.zone.task;

import com.microservices.zone.common.service.IZoneAsyncService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author otto
 */
@Component
public class SyncGitLinkProjectInfoJob {
    private static final Logger logger = LoggerFactory.getLogger(SyncGitLinkProjectInfoJob.class);

    @Autowired
    private IZoneAsyncService zoneAsyncService;

    /**
     * 每日凌晨两点执行一次开源项目从Gitlink获取详细信息
     */
    @Scheduled(cron = "0 0 2 * * ?")
    public void syncGitLinkProjectInfo() {
        logger.info("执行开源项目从Gitlink获取详细信息");
        zoneAsyncService.initProjectGitlinkInfo();
    }
}
