From cdac8d9d994cb146cabcdd4faa8bfbc555944c41 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 8 Feb 2021 14:51:57 +0100 Subject: [PATCH] reset databases in thread --- .../general/maintenance/MaintenanceFragment.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index 708792f836..94e19ba0cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -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() - // should be handled by Plugin-Interface and - // additional service interface and plugin registry - foodPlugin.service?.resetFood() - treatmentsPlugin.service.resetTreatments() - Thread { repository.clearDatabases() } .start() - rxBus.send(EventNewBG(null)) + Thread { + // should be handled by Plugin-Interface and + // additional service interface and plugin registry + foodPlugin.service?.resetFood() + treatmentsPlugin.service.resetTreatments() + repository.clearDatabases() + rxBus.send(EventNewBG(null)) + } .start() }) } }