Commit 8d985b42 authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge pull request #494 from RocketChat/fix/deadlock-on-rocketchat-service

Fix a deadlock on RocketChatService causing some ANR errors
parents 9e1504be f84b288c
......@@ -12,6 +12,7 @@ import java.util.HashMap;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import chat.rocket.android.helper.Logger;
import chat.rocket.persistence.realm.RealmStore;
import hugo.weaving.DebugLog;
import rx.Observable;
......@@ -113,6 +114,10 @@ public class RocketChatService extends Service implements ConnectivityServiceInt
.doOnSuccess(thread -> {
webSocketThreads.put(hostname, thread);
webSocketThreadLock.release();
})
.doOnError(throwable -> {
Logger.report(throwable);
webSocketThreadLock.release();
});
});
}
......
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