package com.inspect.job.task;

import com.inspect.ivs.base.feign.IvsFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@Component
public class VisTask {
    private final IvsFeign ivsFeign;

    public VisTask(IvsFeign ivsFeign) {
        this.ivsFeign = ivsFeign;
    }

    @Scheduled(
            cron = "${ivs.keep_alive}"
    )
    public void keepAlive() throws Exception {
        this.ivsFeign.freshSession();
    }
}
