Sending queue : rename const for more clarity.

This commit is contained in:
ganfra
2024-06-13 13:03:04 +02:00
parent 6d4d9db8a1
commit a1aac5578c
2 changed files with 7 additions and 7 deletions

View File

@@ -31,7 +31,7 @@ import timber.log.Timber
import javax.inject.Inject
@VisibleForTesting
const val SENDING_QUEUE_RETRY_DELAY = 1500L
const val SEND_QUEUES_RETRY_DELAY_MILLIS = 1500L
@SingleIn(SessionScope::class)
class SendQueues @Inject constructor(
@@ -49,7 +49,7 @@ class SendQueues @Inject constructor(
.onEach { roomId: RoomId ->
Timber.d("Send queue disabled for room $roomId")
if (networkMonitor.connectivity.value == NetworkStatus.Online) {
delay(SENDING_QUEUE_RETRY_DELAY)
delay(SEND_QUEUES_RETRY_DELAY_MILLIS)
matrixClient.getRoom(roomId)?.use { room ->
room.setSendQueueEnabled(enabled = true)
}

View File

@@ -51,7 +51,7 @@ import org.junit.Test
sut.launchIn(backgroundScope)
sendQueueDisabledFlow.emit(room.roomId)
advanceTimeBy(SENDING_QUEUE_RETRY_DELAY)
advanceTimeBy(SEND_QUEUES_RETRY_DELAY_MILLIS)
runCurrent()
assert(setAllSendQueuesEnabledLambda)
@@ -79,7 +79,7 @@ import org.junit.Test
sut.launchIn(backgroundScope)
sendQueueDisabledFlow.emit(room.roomId)
advanceTimeBy(SENDING_QUEUE_RETRY_DELAY)
advanceTimeBy(SEND_QUEUES_RETRY_DELAY_MILLIS)
runCurrent()
assert(setAllSendQueuesEnabledLambda)
@@ -96,11 +96,11 @@ import org.junit.Test
matrixClient.setAllSendQueuesEnabledLambda = setEnableSendingQueueLambda
sut.launchIn(backgroundScope)
advanceTimeBy(SENDING_QUEUE_RETRY_DELAY)
advanceTimeBy(SEND_QUEUES_RETRY_DELAY_MILLIS)
networkMonitor.connectivity.value = NetworkStatus.Offline
advanceTimeBy(SENDING_QUEUE_RETRY_DELAY)
advanceTimeBy(SEND_QUEUES_RETRY_DELAY_MILLIS)
networkMonitor.connectivity.value = NetworkStatus.Online
advanceTimeBy(SENDING_QUEUE_RETRY_DELAY)
advanceTimeBy(SEND_QUEUES_RETRY_DELAY_MILLIS)
assert(setEnableSendingQueueLambda)
.isCalledExactly(3)