Main: wrap the Storage instance in CompositeStorage
This commit is contained in:
parent
59ce67e2e5
commit
a9fefcf600
@ -63,6 +63,10 @@ struct Instance final
|
||||
#ifdef ENABLE_DATABASE
|
||||
Database *database;
|
||||
|
||||
/**
|
||||
* This is really a #CompositeStorage. To avoid heavy include
|
||||
* dependencies, we declare it as just #Storage.
|
||||
*/
|
||||
Storage *storage;
|
||||
|
||||
UpdateService *update;
|
||||
|
11
src/Main.cxx
11
src/Main.cxx
@ -71,6 +71,7 @@
|
||||
#include "db/DatabaseSimple.hxx"
|
||||
#include "db/plugins/SimpleDatabasePlugin.hxx"
|
||||
#include "storage/Configured.hxx"
|
||||
#include "storage/CompositeStorage.hxx"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
||||
@ -148,8 +149,16 @@ glue_mapper_init(Error &error)
|
||||
static bool
|
||||
InitStorage(Error &error)
|
||||
{
|
||||
instance->storage = CreateConfiguredStorage(error);
|
||||
Storage *storage = CreateConfiguredStorage(error);
|
||||
if (storage == nullptr)
|
||||
return !error.IsDefined();
|
||||
|
||||
assert(!error.IsDefined());
|
||||
|
||||
CompositeStorage *composite = new CompositeStorage();
|
||||
instance->storage = composite;
|
||||
composite->Mount("", storage);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user