Skip to content

Commit

Permalink
修复停止流程
Browse files Browse the repository at this point in the history
  • Loading branch information
夜色 committed Oct 15, 2016
1 parent 68dd99b commit fb71755
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/mp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ upgrade)
restart)
shift
"$0" stop ${@}
sleep 5
sleep 1
"$0" start ${@}
;;
status)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/shinemo/mpush/alloc/AllocHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void start() {
}

public void stop() {
ZKClient.I.stop();
if (ZKClient.I.isRunning()) ZKClient.I.stop();
scheduledExecutor.shutdown();
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/shinemo/mpush/alloc/AllocServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ protected void doStart(Listener listener) throws Throwable {

@Override
protected void doStop(Listener listener) throws Throwable {
httpServer.stop(60);//1 min
allocHandler.stop();
httpServer.stop(0);//1 min
pushHandler.stop();
allocHandler.stop();
Logs.Console.info("===================================================================");
Logs.Console.info("====================ALLOC SERVER STOPPED SUCCESS=====================");
Logs.Console.info("===================================================================");
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/shinemo/mpush/alloc/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
public final class Main {

public static void main(String[] args) {
Logs.init();
Logs.Console.info("launch alloc server...");
AllocServer server = new AllocServer();
server.start();
addHook(server);
Expand Down

0 comments on commit fb71755

Please sign in to comment.