aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-18 10:34:42 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-18 10:34:42 -0600
commit9c0a050a731382920dc04e64665e2882fa5554e2 (patch)
treee0640231aa82fbd0a73004a2701aaead21f8e4d7 /shared/src/commonMain/kotlin
parente1f3bee440c053b3d3591089a7cd08579de4f0d5 (diff)
parent89a3559823000e23c4898b79a3225d1cd8c0bb3b (diff)
downloadetbsa-trackermap-mobile-9c0a050a731382920dc04e64665e2882fa5554e2.tar.gz
etbsa-trackermap-mobile-9c0a050a731382920dc04e64665e2882fa5554e2.tar.bz2
etbsa-trackermap-mobile-9c0a050a731382920dc04e64665e2882fa5554e2.zip
Merge branch 'main' of https://git.sr.ht/~avalos/trackermap-mobile
Diffstat (limited to 'shared/src/commonMain/kotlin')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/infrastructure/ApiClient.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt5
2 files changed, 5 insertions, 2 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 7d01282..606fef0 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
@@ -41,7 +41,7 @@ open class ApiClient(val baseUrl: String) {
level = LogLevel.ALL
}
engine {
- requestTimeout = 10_000
+ requestTimeout = 20_000
}
}
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
index 71ccbbf..a9ebae2 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt
@@ -22,6 +22,9 @@ class UnitsController(
private val devicesApi: DevicesApi,
private val positionsApi: PositionsApi
) {
+ private companion object {
+ const val UPDATE_TIME = 20
+ }
val displayedUnitsFlow = MutableStateFlow<List<UnitInformation>>(emptyList())
private val unitsFlow = MutableStateFlow<List<UnitInformation>>(emptyList())
@@ -37,7 +40,7 @@ class UnitsController(
}
private suspend fun fetchUnits(scope: CoroutineScope) {
- Coroutines.tickerFlow(10.seconds)
+ Coroutines.tickerFlow(UPDATE_TIME.seconds)
.map {
print("Fetching new positions...\n")
positionsApi.positionsGet()