Use clone for retrofit request to be able to retry

This commit is contained in:
Ganard 2020-01-28 10:13:36 +01:00
parent e5e62dc4a7
commit 15b0bea870

View file

@ -38,7 +38,7 @@ internal class Request<DATA>(private val eventBus: EventBus?) {
suspend fun execute(): DATA {
return try {
val response = apiCall.awaitResponse()
val response = apiCall.clone().awaitResponse()
if (response.isSuccessful) {
response.body()
?: throw IllegalStateException("The request returned a null body")