Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5555676395 |
@@ -33,8 +33,8 @@ android {
|
|||||||
applicationId = "pl.firmatpp.kierowca"
|
applicationId = "pl.firmatpp.kierowca"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 34
|
versionCode = 35
|
||||||
versionName = "1.0.33"
|
versionName = "1.0.34"
|
||||||
setProperty("archivesBaseName", "pl.firmatpp.kierowca")
|
setProperty("archivesBaseName", "pl.firmatpp.kierowca")
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ class DriverLiveSyncClient(
|
|||||||
private val client: OkHttpClient = OkHttpClient(),
|
private val client: OkHttpClient = OkHttpClient(),
|
||||||
private val gson: Gson = Gson(),
|
private val gson: Gson = Gson(),
|
||||||
) {
|
) {
|
||||||
|
private companion object {
|
||||||
|
const val HEARTBEAT_INTERVAL_MS = 10_000L
|
||||||
|
}
|
||||||
|
|
||||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||||
private val started = AtomicBoolean(false)
|
private val started = AtomicBoolean(false)
|
||||||
private var webSocket: WebSocket? = null
|
private var webSocket: WebSocket? = null
|
||||||
@@ -162,7 +166,7 @@ class DriverLiveSyncClient(
|
|||||||
heartbeatJob = scope.launch {
|
heartbeatJob = scope.launch {
|
||||||
while (started.get()) {
|
while (started.get()) {
|
||||||
reportRealtimeStatus("connected")
|
reportRealtimeStatus("connected")
|
||||||
delay(30_000)
|
delay(HEARTBEAT_INTERVAL_MS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user