mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-04 09:16:36 +00:00
memory database not concurrent
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <ripple/app/rdb/RelationalDatabase.h>
|
||||
#include <ripple/core/ConfigSections.h>
|
||||
#include <ripple/nodestore/DatabaseShard.h>
|
||||
#include <ripple/app/rdb/backend/MemoryDatabase.h>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -38,6 +39,7 @@ RelationalDatabase::init(
|
||||
{
|
||||
bool use_sqlite = false;
|
||||
bool use_postgres = false;
|
||||
bool use_memory = false;
|
||||
|
||||
if (config.reporting())
|
||||
{
|
||||
@@ -52,6 +54,10 @@ RelationalDatabase::init(
|
||||
{
|
||||
use_sqlite = true;
|
||||
}
|
||||
else if (boost::iequals(get(rdb_section, "backend"), "memory"))
|
||||
{
|
||||
use_memory = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Throw<std::runtime_error>(
|
||||
@@ -73,6 +79,10 @@ RelationalDatabase::init(
|
||||
{
|
||||
return getPostgresDatabase(app, config, jobQueue);
|
||||
}
|
||||
else if (use_memory)
|
||||
{
|
||||
return getMemoryDatabase(app, config, jobQueue);
|
||||
}
|
||||
|
||||
return std::unique_ptr<RelationalDatabase>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user