Improve DelayedTrackerStore (#8109)

* Improve DelayedTrackerStore

* Review changes
This commit is contained in:
AntsyLich
2022-09-29 19:20:07 +06:00
committed by GitHub
parent 8b9a06e298
commit ad84a8c3e9
3 changed files with 10 additions and 10 deletions

View File

@@ -843,12 +843,14 @@ class ReaderPresenter(
// for a while. The view can still be garbage collected.
async {
runCatching {
if (context.isOnline()) {
try {
if (!context.isOnline()) error("Couldn't update tracker as device is offline")
service.update(updatedTrack.toDbTrack(), true)
insertTrack.await(updatedTrack)
} else {
} catch (e: Exception) {
delayedTrackingStore.addItem(updatedTrack)
DelayedTrackingUpdateJob.setupTask(context)
throw e
}
}
}