|
@@ -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);
|
|
|
}
|
|
|
}
|