Rename internal fun.
This commit is contained in:
parent
dd22cdf7f2
commit
de960116b3
|
@ -31,7 +31,7 @@ internal class SyncRequestStateTracker @Inject constructor() :
|
||||||
private var rootTask: TaskInfo? = null
|
private var rootTask: TaskInfo? = null
|
||||||
|
|
||||||
// Only to be used for incremental sync
|
// Only to be used for incremental sync
|
||||||
fun setStatus(newSyncRequestState: SyncRequestState.IncrementalSyncRequestState) {
|
fun setSyncRequestState(newSyncRequestState: SyncRequestState.IncrementalSyncRequestState) {
|
||||||
syncRequestState.postValue(newSyncRequestState)
|
syncRequestState.postValue(newSyncRequestState)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ internal class DefaultSyncTask @Inject constructor(
|
||||||
syncRequestStateTracker.endAll()
|
syncRequestStateTracker.endAll()
|
||||||
} else {
|
} else {
|
||||||
Timber.tag(loggerTag.value).d("Start incremental sync request with since token $token")
|
Timber.tag(loggerTag.value).d("Start incremental sync request with since token $token")
|
||||||
syncRequestStateTracker.setStatus(SyncRequestState.IncrementalSyncIdle)
|
syncRequestStateTracker.setSyncRequestState(SyncRequestState.IncrementalSyncIdle)
|
||||||
val syncResponse = try {
|
val syncResponse = try {
|
||||||
executeRequest(globalErrorReceiver) {
|
executeRequest(globalErrorReceiver) {
|
||||||
syncAPI.sync(
|
syncAPI.sync(
|
||||||
|
@ -166,7 +166,7 @@ internal class DefaultSyncTask @Inject constructor(
|
||||||
}
|
}
|
||||||
} catch (throwable: Throwable) {
|
} catch (throwable: Throwable) {
|
||||||
Timber.tag(loggerTag.value).e(throwable, "Incremental sync request error")
|
Timber.tag(loggerTag.value).e(throwable, "Incremental sync request error")
|
||||||
syncRequestStateTracker.setStatus(SyncRequestState.IncrementalSyncError)
|
syncRequestStateTracker.setSyncRequestState(SyncRequestState.IncrementalSyncError)
|
||||||
throw throwable
|
throw throwable
|
||||||
}
|
}
|
||||||
val nbRooms = syncResponse.rooms?.invite.orEmpty().size + syncResponse.rooms?.join.orEmpty().size + syncResponse.rooms?.leave.orEmpty().size
|
val nbRooms = syncResponse.rooms?.invite.orEmpty().size + syncResponse.rooms?.join.orEmpty().size + syncResponse.rooms?.leave.orEmpty().size
|
||||||
|
@ -175,7 +175,7 @@ internal class DefaultSyncTask @Inject constructor(
|
||||||
Timber.tag(loggerTag.value).d(
|
Timber.tag(loggerTag.value).d(
|
||||||
"Incremental sync request parsing, $nbRooms room(s) $nbToDevice toDevice(s). Got nextBatch: $nextBatch"
|
"Incremental sync request parsing, $nbRooms room(s) $nbToDevice toDevice(s). Got nextBatch: $nextBatch"
|
||||||
)
|
)
|
||||||
syncRequestStateTracker.setStatus(
|
syncRequestStateTracker.setSyncRequestState(
|
||||||
SyncRequestState.IncrementalSyncParsing(
|
SyncRequestState.IncrementalSyncParsing(
|
||||||
rooms = nbRooms,
|
rooms = nbRooms,
|
||||||
toDevice = nbToDevice
|
toDevice = nbToDevice
|
||||||
|
@ -184,7 +184,7 @@ internal class DefaultSyncTask @Inject constructor(
|
||||||
syncResponseHandler.handleResponse(syncResponse, token, null)
|
syncResponseHandler.handleResponse(syncResponse, token, null)
|
||||||
syncResponseToReturn = syncResponse
|
syncResponseToReturn = syncResponse
|
||||||
Timber.tag(loggerTag.value).d("Incremental sync done")
|
Timber.tag(loggerTag.value).d("Incremental sync done")
|
||||||
syncRequestStateTracker.setStatus(SyncRequestState.IncrementalSyncDone)
|
syncRequestStateTracker.setSyncRequestState(SyncRequestState.IncrementalSyncDone)
|
||||||
}
|
}
|
||||||
syncStatisticsData.treatmentSyncTime = SystemClock.elapsedRealtime()
|
syncStatisticsData.treatmentSyncTime = SystemClock.elapsedRealtime()
|
||||||
syncStatisticsData.nbOfRooms = syncResponseToReturn?.rooms?.join?.size ?: 0
|
syncStatisticsData.nbOfRooms = syncResponseToReturn?.rooms?.join?.size ?: 0
|
||||||
|
|
Loading…
Reference in New Issue