Commit d386e232 authored by 李丛阳's avatar 李丛阳

stop

parent da253db7
......@@ -5,6 +5,7 @@ import org.apache.commons.lang3.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.rcisoft.common.component.Global;
import org.rcisoft.core.command.LxcCommand;
import org.rcisoft.core.result.CommandResult;
import org.rcisoft.core.service.RcRedisService;
......@@ -25,6 +26,10 @@ public class StopLxcJob implements Job {
@Autowired
private LxcCommand lxcCommand;
@Autowired
private Global global;
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
/*1.容器名称*/
......@@ -37,10 +42,13 @@ public class StopLxcJob implements Job {
log.info("----任务异常----");
return;
}
File filePath = new File(containerPath);
if(!filePath.exists() || !filePath.isDirectory()){
log.info("----任务路径异常----");
return;
/*非远程*/
if(!"1".equals(global.getLxcIsRemote())){
File filePath = new File(containerPath);
if (!filePath.exists() || !filePath.isDirectory()) {
log.info("----任务路径异常----");
return;
}
}
/*关闭容器*/
/*2.docker-compose 起容器*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment