瀏覽代碼

重复10次20

TitanWong 1 年之前
父節點
當前提交
c0dbc49429
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/main/java/com/zhili/stationcontrol/tts/service/impl/MusicServiceImpl.java

+ 5 - 1
src/main/java/com/zhili/stationcontrol/tts/service/impl/MusicServiceImpl.java

@@ -67,6 +67,7 @@ public class MusicServiceImpl implements MusicService, Runnable {
                     log.info("startCmd:{},endCmd:{},repeat:{},cmd:{}", startCmd, endCmd, repeat, cmd);
                     log.info("p:{},p.isAlive:{}", p, p == null ? null : p.isAlive());
                     if (startCmd) {
+                        log.info("start");
                         startCmd = false;
                         if (p != null) {
                             p.destroyForcibly();
@@ -76,6 +77,7 @@ public class MusicServiceImpl implements MusicService, Runnable {
                         p = Runtime.getRuntime().exec(cmd);
                     }
                     if (endCmd) {
+                        log.info("end");
                         endCmd = false;
                         if (p != null) {
                             p.destroyForcibly();
@@ -87,12 +89,14 @@ public class MusicServiceImpl implements MusicService, Runnable {
                         if (p != null) {
                             boolean exit = p.waitFor(500, TimeUnit.MILLISECONDS);
                             if (exit) {
-                                log.info("repeat");
+                                log.info("p exit repeat");
                                 p = Runtime.getRuntime().exec(cmd);
                             } else {
+                                log.info("p not exit");
                                 break;
                             }
                         } else {
+                            log.info("p is not null");
                             p = Runtime.getRuntime().exec(cmd);
                         }
                     }