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