diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-18 10:34:20 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-18 10:34:20 -0600 |
commit | 89a3559823000e23c4898b79a3225d1cd8c0bb3b (patch) | |
tree | 5f609445026189aea64186f6077cf888e1d20410 /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers | |
parent | 9f42e2777fc2dc2b6231f559fd544247f9f2c334 (diff) | |
download | etbsa-trackermap-mobile-89a3559823000e23c4898b79a3225d1cd8c0bb3b.tar.gz etbsa-trackermap-mobile-89a3559823000e23c4898b79a3225d1cd8c0bb3b.tar.bz2 etbsa-trackermap-mobile-89a3559823000e23c4898b79a3225d1cd8c0bb3b.zip |
Increased request timeout and fetch units ticker to 20 seconds
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/UnitsController.kt | 5 |
1 files changed, 4 insertions, 1 deletions
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() |