summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/system_fsm/running.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/system_fsm/running.cpp b/src/system_fsm/running.cpp
index 14c5f28b..ec146029 100644
--- a/src/system_fsm/running.cpp
+++ b/src/system_fsm/running.cpp
@@ -142,6 +142,17 @@ auto Running::mountStorage() -> bool {
std::unique_ptr<database::Database>{database_res.value()});
ESP_LOGI(kTag, "storage loaded okay");
+
+ // Tell the database to refresh so that we pick up any changes from the newly
+ // mounted card.
+ sServices->bg_worker().Dispatch<void>([&]() {
+ auto db = sServices->database().lock();
+ if (!db) {
+ return;
+ }
+ db->updateIndexes();
+ });
+
return true;
}