diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-02-01 11:22:26 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-02-01 11:22:26 +1100 |
| commit | 2626c0cffc23c22382ef72aeafecdc107f7ea92c (patch) | |
| tree | f430e746fee646dd136641c20c23aaa827b4831f /src | |
| parent | c8bbd4d52c4ab6c9fcd93915cb3fe23fb63e8279 (diff) | |
| download | tangara-fw-2626c0cffc23c22382ef72aeafecdc107f7ea92c.tar.gz | |
Do a db update after every mount
Diffstat (limited to 'src')
| -rw-r--r-- | src/system_fsm/running.cpp | 11 |
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; } |
