Skip to content

Commit

Permalink
update verion 0.9.12
Browse files Browse the repository at this point in the history
  • Loading branch information
niels1286 committed Jul 9, 2018
1 parent 351f34d commit 272bbd1
Show file tree
Hide file tree
Showing 25 changed files with 39 additions and 25 deletions.
21 changes: 18 additions & 3 deletions client-module/client/src/main/java/io/nuls/client/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import io.nuls.client.rpc.RpcServerManager;
import io.nuls.client.rpc.constant.RpcConstant;
import io.nuls.client.rpc.resources.thread.ShutdownHook;
import io.nuls.client.rpc.resources.util.FileUtil;
import io.nuls.client.storage.LanguageService;
import io.nuls.client.storage.impl.LanguageServiceImpl;
Expand Down Expand Up @@ -61,6 +62,8 @@
* @author: Niels Wang
*/
public class Bootstrap {
private static boolean exitNow;

public static void main(String[] args) {
Thread.currentThread().setName("Nuls");
try {
Expand Down Expand Up @@ -106,15 +109,20 @@ private static void sysStart() throws Exception {
} while (false);
TaskManager.asynExecuteRunnable(new WebViewBootstrap());


int i = 0;
while (true) {
if(exitNow){
Runtime.getRuntime().addShutdownHook(new ShutdownHook());
System.exit(0);
}
try {
//todo 后续启动一个系统监视线程
Thread.sleep(10000L);
Thread.sleep(1000L);
} catch (InterruptedException e) {
Log.error(e);
}
if (null != NulsContext.getInstance().getBestBlock()) {
if (i > 10) {
i = 0;
Log.info("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- netTime : " + (DateUtil.convertDate(new Date(TimeService.currentTimeMillis()))));
Block bestBlock = NulsContext.getInstance().getBestBlock();
Collection<Node> nodes = NulsContext.getServiceBean(NetworkService.class).getAvailableNodes();
Expand All @@ -123,6 +131,8 @@ private static void sysStart() throws Exception {
for (Node node : nodes) {
Log.info(node.getBestBlockHeight() + ", " + node.getId() + ", " + node.getBestBlockHash());
}
} else {
i++;
}
}
}
Expand Down Expand Up @@ -158,4 +168,9 @@ private static Map<String, String> getModuleBootstrapClass() throws Exception {
}
return map;
}

public static void exit() {
exitNow = true;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

package io.nuls.client.rpc.resources;

import io.nuls.client.Bootstrap;
import io.nuls.client.rpc.RpcServerManager;
import io.nuls.client.rpc.resources.dto.UpgradeProcessDTO;
import io.nuls.client.rpc.resources.dto.VersionDto;
Expand Down Expand Up @@ -170,15 +171,13 @@ public RpcClientResult restartSystem() {
@Override
public void run() {
try {
Thread.sleep(1500L);
Thread.sleep(1000L);
} catch (InterruptedException e) {
Log.error(e);
}
RpcServerManager.getInstance().shutdown();
ConnectionManager.getInstance().shutdown();

Runtime.getRuntime().addShutdownHook(new ShutdownHook());
System.exit(0);
Bootstrap.exit();

}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>nuls-wallet</title><link href=/static/css/app.d42049947aa4d6076dd1cb8f3dd2968b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.9f132c13857a8086d2b6.js></script><script type=text/javascript src=/static/js/vendor.6aaa17bc9c476a6a9a92.js></script><script type=text/javascript src=/static/js/app.920eb8751d60ad3976c1.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>nuls-wallet</title><link href=/static/css/app.d42049947aa4d6076dd1cb8f3dd2968b.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.12f6d0e0c78bc0aa3fec.js></script><script type=text/javascript src=/static/js/vendor.6aaa17bc9c476a6a9a92.js></script><script type=text/javascript src=/static/js/app.4cd3308a16cad8750eec.js></script></body></html>

This file was deleted.

Loading

0 comments on commit 272bbd1

Please sign in to comment.