db/update/Walk: move UpdateConfig initialization to class UpdateService

This commit is contained in:
Max Kellermann 2018-07-17 22:39:52 +02:00
parent c3aa53cc97
commit 338a6f2a96
4 changed files with 9 additions and 4 deletions

View File

@ -151,7 +151,7 @@ UpdateService::StartThread(UpdateQueueItem &&i)
modified = false;
next = std::move(i);
walk = new UpdateWalk(GetEventLoop(), listener, *next.storage);
walk = new UpdateWalk(config, GetEventLoop(), listener, *next.storage);
update_thread.Start();

View File

@ -21,6 +21,7 @@
#define MPD_UPDATE_SERVICE_HXX
#include "check.h"
#include "Config.hxx"
#include "Queue.hxx"
#include "event/DeferEvent.hxx"
#include "thread/Thread.hxx"
@ -35,6 +36,8 @@ class CompositeStorage;
* This class manages the update queue and runs the update thread.
*/
class UpdateService final {
const UpdateConfig config;
DeferEvent defer;
SimpleDatabase &db;

View File

@ -49,9 +49,10 @@
#include <stdlib.h>
#include <errno.h>
UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
UpdateWalk::UpdateWalk(const UpdateConfig &_config,
EventLoop &_loop, DatabaseListener &_listener,
Storage &_storage) noexcept
:cancel(false),
:config(_config), cancel(false),
storage(_storage),
editor(_loop, _listener)
{

View File

@ -56,7 +56,8 @@ class UpdateWalk final {
DatabaseEditor editor;
public:
UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
UpdateWalk(const UpdateConfig &_config,
EventLoop &_loop, DatabaseListener &_listener,
Storage &_storage) noexcept;
/**