Skip to content
Snippets Groups Projects
Unverified Commit c20f7667 authored by BMItter's avatar BMItter Committed by GitHub
Browse files

After long update no exposure, additonal logs & potential fix (EXPSOUREAPP-4120) (#1818)


* Use startedAt as fallback when finishedAt ist null to avoid new download tasks get launched while a task is running

* Additional logging on DefaultDiagnosisKeyProvider

* work-runtime-ktx to latest stable

* better mapNotNull, adjusted Exception

* removed worker downgrade for separate PR

Co-authored-by: default avatarRalf Gehrer <ralfgehrer@users.noreply.github.com>
parent 9f96df1a
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