diff options
Diffstat (limited to 'src/db/update')
-rw-r--r-- | src/db/update/Service.hxx | 6 | ||||
-rw-r--r-- | src/db/update/UpdateGlue.cxx | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/db/update/Service.hxx b/src/db/update/Service.hxx index 3ea4baea1..815be6dbc 100644 --- a/src/db/update/Service.hxx +++ b/src/db/update/Service.hxx @@ -26,6 +26,8 @@ #include "event/DeferredMonitor.hxx" #include "thread/Thread.hxx" +class SimpleDatabase; + /** * This class manages the update queue and runs the update thread. */ @@ -36,6 +38,8 @@ class UpdateService final : DeferredMonitor { UPDATE_PROGRESS_DONE = 2 }; + SimpleDatabase &db; + Progress progress; bool modified; @@ -53,7 +57,7 @@ class UpdateService final : DeferredMonitor { UpdateWalk walk; public: - UpdateService(EventLoop &_loop); + UpdateService(EventLoop &_loop, SimpleDatabase &_db); /** * Returns a non-zero job id when we are currently updating diff --git a/src/db/update/UpdateGlue.cxx b/src/db/update/UpdateGlue.cxx index 742fbfe98..a13d56926 100644 --- a/src/db/update/UpdateGlue.cxx +++ b/src/db/update/UpdateGlue.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "Service.hxx" #include "UpdateDomain.hxx" -#include "db/DatabaseSimple.hxx" +#include "db/plugins/SimpleDatabasePlugin.hxx" #include "Idle.hxx" #include "util/Error.hxx" #include "Log.hxx" @@ -44,12 +44,12 @@ UpdateService::Task() SetThreadIdlePriority(); - modified = walk.Walk(*db_get_root(), next.path_utf8.c_str(), + modified = walk.Walk(*db.GetRoot(), next.path_utf8.c_str(), next.discard); - if (modified || !db_exists()) { + if (modified || !db.FileExists()) { Error error; - if (!db_save(error)) + if (!db.Save(error)) LogError(error, "Failed to save database"); } @@ -146,8 +146,7 @@ UpdateService::RunDeferred() } } -UpdateService::UpdateService(EventLoop &_loop) - :DeferredMonitor(_loop), walk(_loop) +UpdateService::UpdateService(EventLoop &_loop, SimpleDatabase &_db) + :DeferredMonitor(_loop), db(_db), walk(_loop) { - assert(db_is_simple()); } |