Skip to content

Commit

Permalink
- Semaphore tryAcquire changed to acquire
Browse files Browse the repository at this point in the history
  • Loading branch information
Semih Özköroğlu committed Mar 16, 2022
1 parent f2b338c commit 09cbe90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions rbs/src/main/java/com/rettermobile/rbs/RBS.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class RBS(
}

fun signInAnonymously() {
RBSLogger.log("signInAnonymously called")
sendAction(action = RBSActions.SIGN_IN_ANONYMOUS.action)
}

Expand Down Expand Up @@ -121,6 +122,7 @@ class RBS(
private fun checkTokenException(exception: Throwable?) {
exception?.let {
if (it is TokenFailException) {
RBSLogger.log("checkTokenException TokenFailException called")
signOut()
}
}
Expand Down Expand Up @@ -187,6 +189,7 @@ class RBS(
}

fun signOut() {
RBSLogger.log("signOut called")
// val request = TokenManager.userId?.let {
// mapOf(Pair("allTokens", true), Pair("userId", it))
// } ?: kotlin.run { mapOf(Pair("allTokens", true)) }
Expand All @@ -201,6 +204,7 @@ class RBS(
}

private fun clearSession() {
RBSLogger.log("clearSession called")
TokenManager.clear()
RBSCloudManager.clear()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RBSNetwork {
val newRequestBuilder = originalRequest.newBuilder()

newRequestBuilder
.header("User-Agent", "rbs-android-sdk-1.1.9.5")
.header("User-Agent", "rbs-android-sdk-1.1.9.7")
.addHeader("Content-Type", "application/json;charset=UTF-8")
.addHeader("x-rbs-sdk-client", "android")
.cacheControl(CacheControl.FORCE_NETWORK)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ object TokenManager {

suspend fun checkToken() {
// Token info control
availableRest.tryAcquire()
availableRest.acquire()
RBSLogger.log("TokenManager.checkToken started")

if (TextUtils.isEmpty(accessToken)) {
Expand Down

0 comments on commit 09cbe90

Please sign in to comment.