From 654fde5f6819cb52a198a524ab78d97e51ab97c7 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 2 Apr 2024 20:41:36 +1100 Subject: Support disabling automatic database updates --- src/system_fsm/running.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/system_fsm/running.cpp') diff --git a/src/system_fsm/running.cpp b/src/system_fsm/running.cpp index a6ab5d47..8625ac66 100644 --- a/src/system_fsm/running.cpp +++ b/src/system_fsm/running.cpp @@ -166,13 +166,15 @@ auto Running::mountStorage() -> bool { // Tell the database to refresh so that we pick up any changes from the newly // mounted card. - sServices->bg_worker().Dispatch([&]() { - auto db = sServices->database().lock(); - if (!db) { - return; - } - db->updateIndexes(); - }); + if (sServices->nvs().DbAutoIndex()) { + sServices->bg_worker().Dispatch([&]() { + auto db = sServices->database().lock(); + if (!db) { + return; + } + db->updateIndexes(); + }); + } return true; } -- cgit v1.2.3