Skip to content

Commit

Permalink
Clean cache. (sofastack#714)
Browse files Browse the repository at this point in the history
* add set method of providerBootStrap

* reset server as null
  • Loading branch information
QilongZhang authored and leizhiyuan committed Aug 21, 2019
1 parent 29caf6c commit 733c473
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,14 @@ public Server getServer() {
return server;
}

/**
* Set server
* @param server
*/
public void setServer(Server server) {
this.server = server;
}

/**
* Sets bound host.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public static void destroyServer(ServerConfig serverConfig) {
try {
Server server = serverConfig.getServer();
if (server != null) {
serverConfig.setServer(null);
SERVER_MAP.remove(Integer.toString(serverConfig.getPort()));
server.destroy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ public void destroyServer() {
Assert.assertEquals(1, ServerFactory.getServers().size());
serverConfig.destroy();
Assert.assertEquals(0, ServerFactory.getServers().size());
Assert.assertNull(serverConfig.getServer());
}
}

0 comments on commit 733c473

Please sign in to comment.