Commit 40fb5adc authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add a few logs

parent e8cdd16d
...@@ -63,6 +63,7 @@ import rx.subjects.PublishSubject; ...@@ -63,6 +63,7 @@ import rx.subjects.PublishSubject;
} }
} }
@DebugLog
@Override @Override
public void ensureConnections() { public void ensureConnections() {
for (String hostname : serverConnectivityList.keySet()) { for (String hostname : serverConnectivityList.keySet()) {
...@@ -146,6 +147,7 @@ import rx.subjects.PublishSubject; ...@@ -146,6 +147,7 @@ import rx.subjects.PublishSubject;
return Observable.concat(Observable.from(getCurrentConnectivityList()), connectivitySubject); return Observable.concat(Observable.from(getCurrentConnectivityList()), connectivitySubject);
} }
@DebugLog
private Single<Boolean> connectToServerIfNeeded(String hostname, boolean forceConnect) { private Single<Boolean> connectToServerIfNeeded(String hostname, boolean forceConnect) {
return Single.defer(() -> { return Single.defer(() -> {
final int connectivity = serverConnectivityList.get(hostname); final int connectivity = serverConnectivityList.get(hostname);
...@@ -163,7 +165,7 @@ import rx.subjects.PublishSubject; ...@@ -163,7 +165,7 @@ import rx.subjects.PublishSubject;
} }
return connectToServer(hostname) return connectToServer(hostname)
//.doOnError(RCLog::e) .doOnError(RCLog::e)
.retryWhen(RxHelper.exponentialBackoff(Integer.MAX_VALUE, 500, TimeUnit.MILLISECONDS)); .retryWhen(RxHelper.exponentialBackoff(Integer.MAX_VALUE, 500, TimeUnit.MILLISECONDS));
}); });
} }
...@@ -191,7 +193,7 @@ import rx.subjects.PublishSubject; ...@@ -191,7 +193,7 @@ import rx.subjects.PublishSubject;
}); });
} }
@DebugLog
private Single<Boolean> waitForConnected(String hostname) { private Single<Boolean> waitForConnected(String hostname) {
return connectivitySubject return connectivitySubject
.filter(serverConnectivity -> hostname.equals(serverConnectivity.hostname)) .filter(serverConnectivity -> hostname.equals(serverConnectivity.hostname))
...@@ -207,6 +209,7 @@ import rx.subjects.PublishSubject; ...@@ -207,6 +209,7 @@ import rx.subjects.PublishSubject;
: Single.error(new ServerConnectivity.DisconnectedException())); : Single.error(new ServerConnectivity.DisconnectedException()));
} }
@DebugLog
private Single<Boolean> waitForDisconnected(String hostname) { private Single<Boolean> waitForDisconnected(String hostname) {
return connectivitySubject return connectivitySubject
.filter(serverConnectivity -> hostname.equals(serverConnectivity.hostname)) .filter(serverConnectivity -> hostname.equals(serverConnectivity.hostname))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment