Better naming and doc

This commit is contained in:
Valere 2022-05-14 11:38:05 +02:00
parent 301ab2af64
commit 7ad39fdc99
3 changed files with 5 additions and 4 deletions

View File

@ -69,7 +69,7 @@ class CommonTestHelper(context: Context) {
MatrixConfiguration(
applicationFlavor = "TestFlavor",
roomDisplayNameFallbackProvider = TestRoomDisplayNameFallbackProvider(),
defaultLongPoolTimeout = 5_000L
syncRequestTimeoutMillis = 5_000L
)
)
}

View File

@ -67,10 +67,11 @@ data class MatrixConfiguration(
val threadMessagesEnabledDefault: Boolean = false,
/**
* Sync loop parameter: The maximum time to wait, in milliseconds, before returning this request.
* Server API configuration for the sync process:
* The maximum time to wait by the homeserver, in milliseconds, before returning the sync response.
* If no events (or other data) become available before this time elapses, the server will return a response with empty fields.
*/
val defaultLongPoolTimeout: Long = 30_000L,
val syncRequestTimeoutMillis: Long = 30_000L,
) {
/**

View File

@ -181,7 +181,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask,
val timeout = when {
previousSyncResponseHasToDevice -> 0L /* Force timeout to 0 */
afterPause -> 0L /* No timeout after a pause */
else -> matrixConfiguration.defaultLongPoolTimeout
else -> matrixConfiguration.syncRequestTimeoutMillis
}
Timber.tag(loggerTag.value).d("Execute sync request with timeout $timeout")
val presence = lightweightSettingsStorage.getSyncPresenceStatus()