
package cn.orionsec.ops.task.impl;

import cn.orionsec.kit.lang.utils.time.Dates;
import cn.orionsec.kit.spring.SpringHolder;
import cn.orionsec.ops.service.api.ApplicationReleaseService;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ReleaseTaskImpl implements Runnable {

    protected static ApplicationReleaseService applicationReleaseService = SpringHolder.getBean(ApplicationReleaseService.class);

    private final Long releaseId;

    public ReleaseTaskImpl(Long releaseId) {
        this.releaseId = releaseId;
    }

    @Override
    public void run() {
        log.info("定时执行发布任务-触发 releaseId: {}, time: {}", releaseId, Dates.current());
        applicationReleaseService.runnableAppRelease(releaseId, true, true);
    }

}
