mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
Adding an option to choose storage engine
This commit is contained in:
parent
ef4e11f00a
commit
8a8ea9d5d4
3 changed files with 20 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/ini_parser.hpp>
|
||||
#include "Base.h"
|
||||
#include "Config.h"
|
||||
#include "FS.h"
|
||||
#include "Log.h"
|
||||
#include "Profiling.h"
|
||||
|
@ -173,7 +174,12 @@ namespace data
|
|||
|
||||
void InitProfilesStorage ()
|
||||
{
|
||||
m_ProfilesStorage.reset(new FsIdentStorage("peerProfiles", "p", "profile-", "txt"));
|
||||
std::string engine;
|
||||
i2p::config::GetOption("storage.engine", engine);
|
||||
if (engine == "lmdb")
|
||||
m_ProfilesStorage.reset(new MdbIdentStorage("peerProfiles.lmdb"));
|
||||
else
|
||||
m_ProfilesStorage.reset(new FsIdentStorage("peerProfiles", "p", "profile-", "txt"));
|
||||
m_ProfilesStorage->Init();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue