diff options
Diffstat (limited to 'shared/src/commonMain/kotlin')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt index 2ae2b2e..dd61893 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt @@ -20,7 +20,7 @@ package mx.trackermap.TrackerMap.client.infrastructure import com.russhwolf.settings.Settings import io.ktor.client.* import io.ktor.client.call.* -import io.ktor.client.engine.cio.* +import io.ktor.client.features.* import io.ktor.client.features.json.* import io.ktor.client.features.json.serializer.KotlinxSerializer import io.ktor.client.features.logging.DEFAULT @@ -47,7 +47,11 @@ open class ApiClient( protected const val ApiFormURLType = "application/x-www-form-urlencoded" protected const val ApiXmlMediaType = "application/xml" - val client: HttpClient = HttpClient(CIO) { + val client: HttpClient = HttpClient { + install(HttpTimeout) { + connectTimeoutMillis = 20_000 + requestTimeoutMillis = 20_000 + } install(JsonFeature) { serializer = KotlinxSerializer( KotlinJson { @@ -59,9 +63,6 @@ open class ApiClient( logger = Logger.DEFAULT level = LogLevel.ALL } - engine { - requestTimeout = 20_000 - } } val defaultHeaders: Map<String, String> = |