Eros: do don't run create on UI thread
This commit is contained in:
parent
523eabd29f
commit
eb8a83d776
1 changed files with 4 additions and 4 deletions
|
@ -22,10 +22,10 @@ class ErosHistory(private val dao: ErosHistoryRecordDao) {
|
||||||
return if (record is ValueWrapper.Existing) record.value else null
|
return if (record is ValueWrapper.Existing) record.value else null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun create(historyRecord: ErosHistoryRecordEntity?) {
|
fun create(historyRecord: ErosHistoryRecordEntity?): Long =
|
||||||
// no need for rowId, but lose warnings in IDE and make sure transaction is completed.
|
Single.just(dao.insert(historyRecord!!))
|
||||||
val rowId = Single.just(dao.insert(historyRecord!!)).blockingGet()
|
.subscribeOn(Schedulers.io())
|
||||||
}
|
.blockingGet()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("USELESS_CAST")
|
@Suppress("USELESS_CAST")
|
||||||
|
|
Loading…
Reference in a new issue