reset databases in thread

This commit is contained in:
Milos Kozak 2021-02-08 14:51:57 +01:00
parent 145765e611
commit cdac8d9d99

View file

@ -49,12 +49,14 @@ class MaintenanceFragment : DaggerFragment() {
activity?.let { activity ->
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.maintenance), resourceHelper.gs(R.string.reset_db_confirm), Runnable {
MainApp.getDbHelper().resetDatabases()
Thread {
// should be handled by Plugin-Interface and
// additional service interface and plugin registry
foodPlugin.service?.resetFood()
treatmentsPlugin.service.resetTreatments()
Thread { repository.clearDatabases() } .start()
repository.clearDatabases()
rxBus.send(EventNewBG(null))
} .start()
})
}
}