package com.friday.distributor.scheduler.execScheduler;

import com.friday.base.common.response.DubboResult;
import com.friday.blank.api.dto.taskType.TaskTypeMachineDto;
import com.friday.distributor.bean.Job;
import com.friday.distributor.scheduler.ExecScheduler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author YaoYao
 * @Date Created In 15:51 2023/3/31
 * @Description
 * @Modified By
 */
@Slf4j
@Component("DefaultUnattendedProgramExecScheduler")
public class DefaultUnattendedProgramExecScheduler extends ExecScheduler {
    @Override
    public DubboResult<TaskTypeMachineDto> distributeExecRobot(Job job, String strategy) {
        return DubboResult.newSuccess(job.getTaskExecConfig().getMachines().get(0));
    }

    @Override
    public DubboResult freeExecRobot(Job job, String strategy) {
        return DubboResult.newSuccess();
    }
}
