1589504: Fix logic handling timeout of queued tasks

This commit is contained in:
Michael Droettboom 2019-10-17 16:28:08 -04:00
Родитель d27e4ce99e
Коммит 616e0aa2c6
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -144,12 +144,14 @@ internal object Dispatchers {
// wait up to 5 seconds for it to complete, otherwise we will reset the flag so that
// new tasks may continue to run.
runBlocking {
withTimeoutOrNull(QUEUE_PROCESSING_TIMEOUT_MS) {
if (withTimeoutOrNull(QUEUE_PROCESSING_TIMEOUT_MS) {
job.join()
}?.let {
} == null) {
Log.e(LOG_TAG, "Timeout processing initial tasks queue")
queueInitialTasks.set(false)
taskQueue.clear()
} else {
Log.i(LOG_TAG, "Initial tasks queue completed successfully")
}
}
}