package com.pcloud.book.skill.remind;

import com.pcloud.book.skill.biz.PcloudSubRemindBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component("remindSchedule")
public class RemindSchedule {

    @Autowired
    private PcloudSubRemindBiz pcloudSubRemindBiz;

    @Scheduled(cron = "0 * * * * ?")
    public void skillRemindMessage() {
        String key="REMIND_SCHEDULE";
        while (!RedisTool.lock(key)){
            return;
        }
        new Thread(() -> {
            pcloudSubRemindBiz.sendTimeTaskMessage();
        }).start();
    }

}
