fix database cleanup
This commit is contained in:
parent
0f4dd15a27
commit
e62bb19b49
3 changed files with 4 additions and 3 deletions
|
@ -123,7 +123,7 @@ import kotlin.math.roundToInt
|
|||
val ret = StringBuilder()
|
||||
removed
|
||||
.filter { it.second > 0 }
|
||||
.map { ret.append(it.first + " " + it.second + "\n") }
|
||||
.map { ret.append(it.first + " " + it.second + "<br>") }
|
||||
return ret.toString()
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class PersistenceLayerImpl @Inject constructor(
|
|||
|
||||
private val disposable = CompositeDisposable()
|
||||
override fun clearDatabases() = repository.clearDatabases()
|
||||
override fun cleanupDatabase(keepDays: Long, deleteTrackedChanges: Boolean): String = cleanupDatabase(keepDays, deleteTrackedChanges)
|
||||
override fun cleanupDatabase(keepDays: Long, deleteTrackedChanges: Boolean): String = repository.cleanupDatabase(keepDays, deleteTrackedChanges)
|
||||
|
||||
override fun insertOrUpdate(bolusCalculatorResult: BolusCalculatorResult) {
|
||||
disposable += repository.runTransactionForResult(InsertOrUpdateBolusCalculatorResultTransaction(bolusCalculatorResult))
|
||||
|
|
|
@ -119,7 +119,8 @@ class MaintenanceFragment : DaggerFragment() {
|
|||
onError = { aapsLogger.error("Error cleaning up databases", it) },
|
||||
onComplete = {
|
||||
if (result.isNotEmpty())
|
||||
OKDialog.show(activity, rh.gs(info.nightscout.core.ui.R.string.result), HtmlHelper.fromHtml("<b>" + rh.gs(R.string.cleared_entries) + "</b>\n" + result).toSpanned())
|
||||
OKDialog.show(activity, rh.gs(info.nightscout.core.ui.R.string.result), HtmlHelper.fromHtml("<b>" + rh.gs(R.string.cleared_entries) + "</b><br>" + result)
|
||||
.toSpanned())
|
||||
aapsLogger.info(LTag.CORE, "Cleaned up databases with result: $result")
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue