generated from root/miduo_server
服务器推荐
parent
1fc754596a
commit
7d389693b9
|
|
@ -55,7 +55,7 @@ public class GetServerListController extends HttpServlet {
|
|||
|
||||
List<DBObject> serverList = new ArrayList<>();
|
||||
long local = System.currentTimeMillis();
|
||||
if ((local - lastRefreshTime) > 60 * 1000 || serverInfosCache.isEmpty()) {
|
||||
if ((local - lastRefreshTime) > 10 * 1000 || serverInfosCache.isEmpty()) {
|
||||
serverInfosCache.clear();
|
||||
lastRefreshTime = local;
|
||||
recommend = "";
|
||||
|
|
@ -133,7 +133,7 @@ public class GetServerListController extends HttpServlet {
|
|||
Map<String, UserRecentLoginInfo> userServerInfoMap = BaseGlobal.getInstance().redisApp.hgetAll(RedisKey.USER_SERVER_INFO, openId, UserRecentLoginInfo.class, -1, false);
|
||||
DBObject myLastServer = null;
|
||||
List<String> myServerList = new ArrayList<>();
|
||||
int time = 0;
|
||||
long time = 0;
|
||||
for (Map.Entry<String, UserRecentLoginInfo> entry : userServerInfoMap.entrySet()) {
|
||||
if(!serverInfosCache.keySet().contains(entry.getKey())){
|
||||
//服务器已清除
|
||||
|
|
@ -141,6 +141,7 @@ public class GetServerListController extends HttpServlet {
|
|||
}
|
||||
myServerList.add(entry.getKey());
|
||||
if (entry.getValue().getLoginTime() > time) {
|
||||
time =entry.getValue().getLoginTime();
|
||||
myLastServer = getDBObject(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public class RedisApp {
|
|||
public <K, T> T get(final String type, final K key, final Class<T> clazz, final int seconds,
|
||||
boolean withServerId) throws Exception {
|
||||
String fullKey = getKey(type, key, withServerId);
|
||||
System.out.println("-------fullKey---------"+fullKey);
|
||||
String strValue = redisUtil.get(fullKey);
|
||||
if (strValue == null) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue