Set maxProgress to correct value
This commit is contained in:
parent
f3d8690f5c
commit
1d88d16545
1 changed files with 2 additions and 2 deletions
|
@ -356,7 +356,7 @@ class OpenHumansUploader @Inject constructor(
|
|||
if (currentProgress % 1000L == 0L) showOngoingNotification(maxProgress, currentProgress)
|
||||
}
|
||||
copyDisposable = Completable.fromCallable { MainApp.getDbHelper().clearOpenHumansQueue() }
|
||||
.andThen(Single.defer { Single.just(MainApp.getDbHelper().countOfAllRows) })
|
||||
.andThen(Single.defer { Single.just(MainApp.getDbHelper().countOfAllRows + treatmentsPlugin.service.count()) })
|
||||
.doOnSuccess { maxProgress = it }
|
||||
.flatMapObservable { Observable.defer { Observable.fromIterable(treatmentsPlugin.service.treatmentData) } }
|
||||
.map { enqueueTreatment(it); increaseCounter() }
|
||||
|
@ -648,4 +648,4 @@ class OpenHumansUploader @Inject constructor(
|
|||
private fun onSharedPreferenceChanged(event: EventPreferenceChange) {
|
||||
if (event.changedKey == "key_oh_charging_only" && isSetup) scheduleWorker(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue