Bug fixes

This commit is contained in:
DrKLO 2014-07-16 13:36:07 +04:00
parent 5bed3fb6cd
commit d24578fe6b

View file

@ -1185,6 +1185,8 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
requestStartTime = updatingDcStartTime; requestStartTime = updatingDcStartTime;
updatingDcStartTime = currentTime; updatingDcStartTime = currentTime;
timeout = 60; timeout = 60;
} else {
request.runningStartTime = 0;
} }
if (requestStartTime != 0 && requestStartTime < currentTime - timeout) { if (requestStartTime != 0 && requestStartTime < currentTime - timeout) {
ArrayList<Datacenter> allDc = new ArrayList<Datacenter>(datacenters.values()); ArrayList<Datacenter> allDc = new ArrayList<Datacenter>(datacenters.values());
@ -1196,7 +1198,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} }
} }
Datacenter newDc = allDc.get(Math.abs(Utilities.random.nextInt() % allDc.size())); Datacenter newDc = allDc.get(Math.abs(Utilities.random.nextInt() % allDc.size()));
datacenterId = request.runningDatacenterId = newDc.datacenterId; datacenterId = newDc.datacenterId;
if (!(request.rawRequest instanceof TLRPC.TL_help_getConfig)) {
currentDatacenterId = datacenterId;
} else {
request.runningDatacenterId = datacenterId;
}
} }
} }