generated from root/miduo_server
服务器推荐
parent
cd3409f779
commit
1fc754596a
|
|
@ -54,7 +54,6 @@ public class GetServerListController extends HttpServlet {
|
||||||
req.put("plat", plat);
|
req.put("plat", plat);
|
||||||
|
|
||||||
List<DBObject> serverList = new ArrayList<>();
|
List<DBObject> serverList = new ArrayList<>();
|
||||||
List<String> serverIDList = new ArrayList<>();
|
|
||||||
long local = System.currentTimeMillis();
|
long local = System.currentTimeMillis();
|
||||||
if ((local - lastRefreshTime) > 60 * 1000 || serverInfosCache.isEmpty()) {
|
if ((local - lastRefreshTime) > 60 * 1000 || serverInfosCache.isEmpty()) {
|
||||||
serverInfosCache.clear();
|
serverInfosCache.clear();
|
||||||
|
|
@ -115,7 +114,6 @@ public class GetServerListController extends HttpServlet {
|
||||||
res.put("ip", ip);
|
res.put("ip", ip);
|
||||||
res.put("port", port);
|
res.put("port", port);
|
||||||
serverList.add(res);
|
serverList.add(res);
|
||||||
serverIDList.add(server_id);
|
|
||||||
serverInfosCache.put(serverInfo.get("server_id").toString(), res);
|
serverInfosCache.put(serverInfo.get("server_id").toString(), res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,7 +135,7 @@ public class GetServerListController extends HttpServlet {
|
||||||
List<String> myServerList = new ArrayList<>();
|
List<String> myServerList = new ArrayList<>();
|
||||||
int time = 0;
|
int time = 0;
|
||||||
for (Map.Entry<String, UserRecentLoginInfo> entry : userServerInfoMap.entrySet()) {
|
for (Map.Entry<String, UserRecentLoginInfo> entry : userServerInfoMap.entrySet()) {
|
||||||
if(!serverIDList.contains(entry.getKey())){
|
if(!serverInfosCache.keySet().contains(entry.getKey())){
|
||||||
//服务器已清除
|
//服务器已清除
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue