File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
app/src/main/java/com/kylecorry/preparedness_feed/infrastructure/alerts Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,16 @@ class AlertUpdater(private val context: Context) {
4343
4444 val runner = ParallelCoroutineRunner ()
4545 val allAlerts = runner.map(sources) {
46- val sourceAlerts =
47- it.getAlerts(minTime).filter { alert -> alert.publishedDate.isAfter(minTime) }
48- synchronized(lock) {
49- completedCount++
50- setProgress(completedCount.toFloat() / totalCount)
46+ tryOrDefault(emptyList()) {
47+ // TODO: If this fails, let the user know
48+ val sourceAlerts =
49+ it.getAlerts(minTime).filter { alert -> alert.publishedDate.isAfter(minTime) }
50+ synchronized(lock) {
51+ completedCount++
52+ setProgress(completedCount.toFloat() / totalCount)
53+ }
54+ sourceAlerts
5155 }
52- sourceAlerts
5356 }.flatten()
5457
5558 val newAlerts = allAlerts.filter { alert ->
You can’t perform that action at this time.
0 commit comments