File tree Expand file tree Collapse file tree
flipcash/src/main/kotlin/com/flipcash/services/internal/network/api
opencode/src/main/kotlin/com/getcode/opencode/internal/network/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import com.google.protobuf.Timestamp
1313import io.grpc.ManagedChannel
1414import kotlinx.coroutines.Dispatchers
1515import kotlinx.coroutines.withContext
16+ import java.util.concurrent.TimeUnit
1617import javax.inject.Inject
1718import com.codeinc.flipcash.gen.account.v1.FlipcashAccountService as RpcAccountService
1819
@@ -22,6 +23,8 @@ class AccountApi @Inject constructor(
2223) : GrpcApi(managedChannel) {
2324
2425 private val api = AccountGrpcKt .AccountCoroutineStub (managedChannel)
26+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
27+ .withWaitForReady()
2528
2629 /* *
2730 * Registers a new user, bound to the provided PublicKey.
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import com.getcode.opencode.model.core.ID
1515import io.grpc.ManagedChannel
1616import kotlinx.coroutines.Dispatchers
1717import kotlinx.coroutines.withContext
18+ import java.util.concurrent.TimeUnit
1819import javax.inject.Inject
1920
2021class ActivityFeedApi @Inject constructor(
@@ -23,6 +24,8 @@ class ActivityFeedApi @Inject constructor(
2324) : GrpcApi(managedChannel) {
2425
2526 private val api = ActivityFeedGrpcKt .ActivityFeedCoroutineStub (managedChannel)
27+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
28+ .withWaitForReady()
2629
2730 /* *
2831 * Gets the latest [maxItems] notifications in a user's activity feed.
Original file line number Diff line number Diff line change @@ -12,13 +12,16 @@ import com.getcode.opencode.internal.network.core.GrpcApi
1212import io.grpc.ManagedChannel
1313import kotlinx.coroutines.Dispatchers
1414import kotlinx.coroutines.withContext
15+ import java.util.concurrent.TimeUnit
1516import javax.inject.Inject
1617
1718class PurchaseApi @Inject constructor(
1819 @FlipcashManagedChannel
1920 managedChannel : ManagedChannel ,
2021) : GrpcApi(managedChannel) {
2122 private val api = IapGrpcKt .IapCoroutineStub (managedChannel)
23+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
24+ .withWaitForReady()
2225
2326 // OnPurchaseCompleted is called when an IAP has been completed
2427 suspend fun onPurchaseCompleted (
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import com.getcode.opencode.internal.network.core.GrpcApi
1010import io.grpc.ManagedChannel
1111import kotlinx.coroutines.Dispatchers
1212import kotlinx.coroutines.withContext
13+ import java.util.concurrent.TimeUnit
1314import javax.inject.Inject
1415
1516class PushApi @Inject constructor(
@@ -18,6 +19,8 @@ class PushApi @Inject constructor(
1819) : GrpcApi(managedChannel) {
1920
2021 private val api = PushGrpcKt .PushCoroutineStub (managedChannel)
22+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
23+ .withWaitForReady()
2124
2225 /* *
2326 * Adds a push token associated with a user.
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ internal class AccountApi @Inject constructor(
2121): GrpcApi(managedChannel) {
2222
2323 private val api = AccountGrpcKt .AccountCoroutineStub (managedChannel)
24+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
25+ .withWaitForReady()
2426
2527 /* *
2628 * Returns whether an owner account is a Code account. This hints
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import kotlinx.coroutines.Dispatchers
1010import kotlinx.coroutines.flow.Flow
1111import kotlinx.coroutines.flow.flowOn
1212import kotlinx.coroutines.withContext
13+ import java.util.concurrent.TimeUnit
1314import javax.inject.Inject
1415
1516internal class CurrencyApi @Inject constructor(
@@ -18,6 +19,8 @@ internal class CurrencyApi @Inject constructor(
1819): GrpcApi(managedChannel) {
1920
2021 private val api = CurrencyGrpcKt .CurrencyCoroutineStub (managedChannel)
22+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
23+ .withWaitForReady()
2124 /* *
2225 * Returns the exchange rates for the core mint token against all available currencies
2326 *
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import kotlinx.coroutines.Dispatchers
1515import kotlinx.coroutines.flow.Flow
1616import kotlinx.coroutines.withContext
1717import java.io.ByteArrayOutputStream
18+ import java.util.concurrent.TimeUnit
1819import javax.inject.Inject
1920
2021internal class MessagingApi @Inject constructor(
@@ -23,6 +24,8 @@ internal class MessagingApi @Inject constructor(
2324): GrpcApi(managedChannel) {
2425
2526 private val api = MessagingGrpcKt .MessagingCoroutineStub (managedChannel)
27+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
28+ .withWaitForReady()
2629
2730 /* *
2831 * Opens a stream of messages. Messages are routed using the public key of a rendezvous keypair
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import io.grpc.ManagedChannel
2727import kotlinx.coroutines.Dispatchers
2828import kotlinx.coroutines.flow.Flow
2929import kotlinx.coroutines.withContext
30+ import java.util.concurrent.TimeUnit
3031import javax.inject.Inject
3132
3233class TransactionApi @Inject constructor(
@@ -35,6 +36,8 @@ class TransactionApi @Inject constructor(
3536): GrpcApi(managedChannel) {
3637
3738 private val api = TransactionGrpcKt .TransactionCoroutineStub (managedChannel)
39+ .withDeadlineAfter(2000 , TimeUnit .MILLISECONDS )
40+ .withWaitForReady()
3841
3942 /* *
4043 * The mechanism for client and server to agree upon a set of
You can’t perform that action at this time.
0 commit comments