db/update/Walk: move UpdateConfig initialization to class UpdateService
This commit is contained in:
parent
c3aa53cc97
commit
338a6f2a96
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue