Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
skhugh committed Apr 12, 2024
1 parent 2b76b2c commit f975674
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yorkie/src/main/kotlin/dev/yorkie/core/Client.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.yorkie.core

import androidx.annotation.VisibleForTesting
import com.connectrpc.Code
import com.connectrpc.ConnectException
import com.connectrpc.ProtocolClientConfig
import com.connectrpc.ServerOnlyStreamInterface
Expand Down Expand Up @@ -306,7 +307,9 @@ public class Client @VisibleForTesting internal constructor(
retry = 0
}.onFailure {
retry++
if (retry > 3 || it is ClosedReceiveChannelException) {
if (retry > 3 || it is ClosedReceiveChannelException ||
(it as? ConnectException)?.code == Code.UNAVAILABLE
) {
_streamConnectionStatus.emit(StreamConnectionStatus.Disconnected)
stream.safeClose()
}
Expand Down

0 comments on commit f975674

Please sign in to comment.