服务器推荐

master
zhangshanxue 2019-11-05 13:44:04 +08:00
parent 1fc754596a
commit 7d389693b9
2 changed files with 3 additions and 3 deletions

View File

@ -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());
}
}

View File

@ -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;