mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-18 13:00:18 +03:00
Add missing synchronized
This commit is contained in:
parent
d85d44bf4b
commit
f106176752
1 changed files with 7 additions and 5 deletions
|
@ -44,11 +44,13 @@ internal class ApiInterceptor @Inject constructor() : Interceptor {
|
||||||
|
|
||||||
val response = chain.proceed(request)
|
val response = chain.proceed(request)
|
||||||
|
|
||||||
findApiPath(path, method)?.let { apiPath ->
|
synchronized(apiResponseListenersMap) {
|
||||||
response.peekBody(Long.MAX_VALUE).string().let { networkResponse ->
|
findApiPath(path, method)?.let { apiPath ->
|
||||||
apiResponseListenersMap[apiPath]?.forEach { listener ->
|
response.peekBody(Long.MAX_VALUE).string().let { networkResponse ->
|
||||||
tryOrNull("Error in the implementation") {
|
apiResponseListenersMap[apiPath]?.forEach { listener ->
|
||||||
listener.onApiResponse(apiPath, networkResponse)
|
tryOrNull("Error in the implementation") {
|
||||||
|
listener.onApiResponse(apiPath, networkResponse)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue