Skip to content

Commit fb71755

Browse files
author
夜色
committed
修复停止流程
1 parent 68dd99b commit fb71755

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

bin/mp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ upgrade)
231231
restart)
232232
shift
233233
"$0" stop ${@}
234-
sleep 5
234+
sleep 1
235235
"$0" start ${@}
236236
;;
237237
status)

src/main/java/com/shinemo/mpush/alloc/AllocHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void start() {
6262
}
6363

6464
public void stop() {
65-
ZKClient.I.stop();
65+
if (ZKClient.I.isRunning()) ZKClient.I.stop();
6666
scheduledExecutor.shutdown();
6767
}
6868

src/main/java/com/shinemo/mpush/alloc/AllocServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ protected void doStart(Listener listener) throws Throwable {
6969

7070
@Override
7171
protected void doStop(Listener listener) throws Throwable {
72-
httpServer.stop(60);//1 min
73-
allocHandler.stop();
72+
httpServer.stop(0);//1 min
7473
pushHandler.stop();
74+
allocHandler.stop();
7575
Logs.Console.info("===================================================================");
7676
Logs.Console.info("====================ALLOC SERVER STOPPED SUCCESS=====================");
7777
Logs.Console.info("===================================================================");

src/main/java/com/shinemo/mpush/alloc/Main.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
public final class Main {
3232

3333
public static void main(String[] args) {
34+
Logs.init();
35+
Logs.Console.info("launch alloc server...");
3436
AllocServer server = new AllocServer();
3537
server.start();
3638
addHook(server);

0 commit comments

Comments
 (0)