db/update/Walk: move UpdateConfig initialization to class UpdateService
This commit is contained in:
		@@ -151,7 +151,7 @@ UpdateService::StartThread(UpdateQueueItem &&i)
 | 
				
			|||||||
	modified = false;
 | 
						modified = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	next = std::move(i);
 | 
						next = std::move(i);
 | 
				
			||||||
	walk = new UpdateWalk(GetEventLoop(), listener, *next.storage);
 | 
						walk = new UpdateWalk(config, GetEventLoop(), listener, *next.storage);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	update_thread.Start();
 | 
						update_thread.Start();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@
 | 
				
			|||||||
#define MPD_UPDATE_SERVICE_HXX
 | 
					#define MPD_UPDATE_SERVICE_HXX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "check.h"
 | 
					#include "check.h"
 | 
				
			||||||
 | 
					#include "Config.hxx"
 | 
				
			||||||
#include "Queue.hxx"
 | 
					#include "Queue.hxx"
 | 
				
			||||||
#include "event/DeferEvent.hxx"
 | 
					#include "event/DeferEvent.hxx"
 | 
				
			||||||
#include "thread/Thread.hxx"
 | 
					#include "thread/Thread.hxx"
 | 
				
			||||||
@@ -35,6 +36,8 @@ class CompositeStorage;
 | 
				
			|||||||
 * This class manages the update queue and runs the update thread.
 | 
					 * This class manages the update queue and runs the update thread.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
class UpdateService final {
 | 
					class UpdateService final {
 | 
				
			||||||
 | 
						const UpdateConfig config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	DeferEvent defer;
 | 
						DeferEvent defer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SimpleDatabase &db;
 | 
						SimpleDatabase &db;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,9 +49,10 @@
 | 
				
			|||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <errno.h>
 | 
					#include <errno.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
 | 
					UpdateWalk::UpdateWalk(const UpdateConfig &_config,
 | 
				
			||||||
 | 
							       EventLoop &_loop, DatabaseListener &_listener,
 | 
				
			||||||
		       Storage &_storage) noexcept
 | 
							       Storage &_storage) noexcept
 | 
				
			||||||
	:cancel(false),
 | 
						:config(_config), cancel(false),
 | 
				
			||||||
	 storage(_storage),
 | 
						 storage(_storage),
 | 
				
			||||||
	 editor(_loop, _listener)
 | 
						 editor(_loop, _listener)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,8 @@ class UpdateWalk final {
 | 
				
			|||||||
	DatabaseEditor editor;
 | 
						DatabaseEditor editor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
	UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
 | 
						UpdateWalk(const UpdateConfig &_config,
 | 
				
			||||||
 | 
							   EventLoop &_loop, DatabaseListener &_listener,
 | 
				
			||||||
		   Storage &_storage) noexcept;
 | 
							   Storage &_storage) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user