Skip to content
Snippets Groups Projects
Unverified Commit c29dc124 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Merge pull request #1867 from corona-warn-app/fix/merge-18x-into-19x-v2

Merge 1.8.x into 1.9.x
parents 6697cfb0 2fb344bb
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ class DefaultDiagnosisKeyProvider @Inject constructor( ...@@ -59,6 +59,7 @@ class DefaultDiagnosisKeyProvider @Inject constructor(
provideDiagnosisKeysTask provideDiagnosisKeysTask
.addOnSuccessListener { cont.resume(true) } .addOnSuccessListener { cont.resume(true) }
.addOnFailureListener { .addOnFailureListener {
Timber.w("Key submission failed because ${it.message}")
val wrappedException = val wrappedException =
when (it is ApiException && when (it is ApiException &&
it.statusCode == ReportingConstants.STATUS_CODE_REACHED_REQUEST_LIMIT) { it.statusCode == ReportingConstants.STATUS_CODE_REACHED_REQUEST_LIMIT) {
......
...@@ -26,7 +26,6 @@ import kotlinx.coroutines.flow.map ...@@ -26,7 +26,6 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.joda.time.Duration import org.joda.time.Duration
import timber.log.Timber import timber.log.Timber
import java.util.NoSuchElementException
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
...@@ -153,11 +152,10 @@ class TracingRepository @Inject constructor( ...@@ -153,11 +152,10 @@ class TracingRepository @Inject constructor(
val taskLastFinishedAt = try { val taskLastFinishedAt = try {
taskController.tasks.first() taskController.tasks.first()
.filter { it.taskState.type == DownloadDiagnosisKeysTask::class } .filter { it.taskState.type == DownloadDiagnosisKeysTask::class }
.mapNotNull { it.taskState.finishedAt } .mapNotNull { it.taskState.finishedAt ?: it.taskState.startedAt }
.sortedDescending() .maxOrNull()!!
.first() } catch (e: NullPointerException) {
} catch (e: NoSuchElementException) { Timber.tag(TAG).v("download did not run recently - no task with a date found")
Timber.tag(TAG).v("download did not run recently - no task with a finishedAt date found")
return true return true
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment