瀏覽代碼

add offline queue4

xiewj 3 月之前
父節點
當前提交
aba12c5aff

+ 4 - 5
720yun_fd_base/gis_common/src/main/java/com/gis/common/util/CmdUtils.java

@@ -1,9 +1,7 @@
 package com.gis.common.util;
 package com.gis.common.util;
 
 
 import cn.hutool.core.util.RuntimeUtil;
 import cn.hutool.core.util.RuntimeUtil;
-import lombok.extern.log4j.Log4j2;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
 
 
 import java.io.BufferedReader;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.IOException;
@@ -130,14 +128,15 @@ public class CmdUtils {
      * 调用算法 xx.sh 脚本
      * 调用算法 xx.sh 脚本
      * @param command
      * @param command
      */
      */
-    public static void callShell_1(String command){
+    public static void callLineSh(String command, Integer lineSize){
         log.info("cmd: {}", command);
         log.info("cmd: {}", command);
         try {
         try {
             String[] cmd = new String[]{"/bin/sh", "-c", command};
             String[] cmd = new String[]{"/bin/sh", "-c", command};
             Process process = Runtime.getRuntime().exec(cmd);
             Process process = Runtime.getRuntime().exec(cmd);
+            CmdUtils.log.info("开始运行");
             StreamGobblerLine errorGobbler = new StreamGobblerLine(process.getErrorStream(), "ERROR");
             StreamGobblerLine errorGobbler = new StreamGobblerLine(process.getErrorStream(), "ERROR");
             errorGobbler.start();
             errorGobbler.start();
-            StreamGobblerLine outGobbler = new StreamGobblerLine(process.getInputStream(), "STDOUT");
+            StreamGobblerLine outGobbler = new StreamGobblerLine(process.getInputStream(), "STDOUT", lineSize);
             outGobbler.start();
             outGobbler.start();
             process.waitFor();
             process.waitFor();
         } catch (Exception e) {
         } catch (Exception e) {
@@ -167,6 +166,6 @@ public class CmdUtils {
 
 
     }
     }
     public static void callLineSh(String command){
     public static void callLineSh(String command){
-        callLine(command, null);
+        callLineSh(command, null);
     }
     }
 }
 }

+ 1 - 1
720yun_fd_base/gis_service/src/main/java/com/gis/service/impl/FodderServiceImpl.java

@@ -791,7 +791,7 @@ public class FodderServiceImpl extends ServiceImpl<FodderMapper,FodderEntity> im
             @Override
             @Override
             public String call() throws Exception {
             public String call() throws Exception {
                 MDC.put("TRACE_ID", traceId);
                 MDC.put("TRACE_ID", traceId);
-                CmdUtils.callLine(cmd, 200);
+                CmdUtils.callLineSh(cmd);
                 long end = System.currentTimeMillis();
                 long end = System.currentTimeMillis();
                 log.info("切图完成耗时: {} s" ,(end-start)/1000);
                 log.info("切图完成耗时: {} s" ,(end-start)/1000);
                 log.warn("end processListener : "+ id);
                 log.warn("end processListener : "+ id);

+ 1 - 1
720yun_fd_base/gis_service/src/main/java/com/gis/service/impl/TestServiceImpl.java

@@ -201,7 +201,7 @@ public class TestServiceImpl implements TestService {
         }
         }
 
 
         log.info("cmd : {}", cmd);
         log.info("cmd : {}", cmd);
-        CmdUtils.callShell_1(cmd);
+        CmdUtils.callLineSh(cmd);
         return Result.success();
         return Result.success();
     }
     }
 
 

+ 1 - 1
720yun_fd_consumer/src/main/java/com/gis/listener/container/SceneWorkQueueListener.java

@@ -476,7 +476,7 @@ public class SceneWorkQueueListener implements ChannelAwareMessageListener {
             @Override
             @Override
             public String call() throws Exception {
             public String call() throws Exception {
                 MDC.put("TRACE_ID", traceId);
                 MDC.put("TRACE_ID", traceId);
-                CmdUtils.callLine(cmd, 200);
+                CmdUtils.callLineSh(cmd);
                 long end = System.currentTimeMillis();
                 long end = System.currentTimeMillis();
                 log.info("切图完成耗时: {} s" ,(end-start)/1000);
                 log.info("切图完成耗时: {} s" ,(end-start)/1000);
                 return "执行完成";
                 return "执行完成";