mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-05-24 08:35:35 -04:00
[MOS-853] Purge multimedia database when initializing indexer
When startup indexer for FileIndexer starts, it checks for lock file. If it's not present, it starts the indexing. Due to changes in DB initialization we have to purge the DB before starting the init scan because of potential restore content
This commit is contained in:
committed by
Bartosz Cichocki
parent
9744d39137
commit
ca7de85fef
@@ -29,6 +29,7 @@ target_link_libraries(service-fileindexer
|
||||
module-os
|
||||
module-utils
|
||||
module-vfs
|
||||
module-sys
|
||||
module-sys
|
||||
module-db
|
||||
tag
|
||||
)
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include <purefs/fs/inotify_message.hpp>
|
||||
#include <log/log.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <optional>
|
||||
#include <queries/multimedia_files/QueryMultimediaFilesRemove.hpp>
|
||||
#include <service-db/DBServiceAPI.hpp>
|
||||
|
||||
namespace service::detail
|
||||
{
|
||||
@@ -126,6 +126,10 @@ namespace service::detail
|
||||
{
|
||||
if (!hasLockFile()) {
|
||||
LOG_INFO("Initial startup indexer - Started...");
|
||||
|
||||
auto query = std::make_unique<db::multimedia_files::query::RemoveAll>();
|
||||
DBServiceAPI::GetQuery(svc.get(), db::Interface::Name::MultimediaFiles, std::move(query));
|
||||
|
||||
mTopDirIterator = std::begin(directoriesToScan);
|
||||
setupTimers(svc, svc_name);
|
||||
mForceStop = false;
|
||||
|
||||
Reference in New Issue
Block a user