1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-11-30 07:20:08 +01:00

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