mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +00:00
Fix invalid shard removal
This commit is contained in:
committed by
Nik Bougalis
parent
1c3c69f8b5
commit
ce5f240551
@@ -52,6 +52,29 @@ Shard::Shard(
|
||||
Throw<std::runtime_error>("Shard: Invalid index");
|
||||
}
|
||||
|
||||
Shard::~Shard()
|
||||
{
|
||||
if (removeOnDestroy_)
|
||||
{
|
||||
backend_.reset();
|
||||
lgrSQLiteDB_.reset();
|
||||
txSQLiteDB_.reset();
|
||||
acquireInfo_.reset();
|
||||
|
||||
try
|
||||
{
|
||||
boost::filesystem::remove_all(dir_);
|
||||
}
|
||||
catch (std::exception const& e)
|
||||
{
|
||||
JLOG(j_.error()) <<
|
||||
"shard " << index_ <<
|
||||
" exception " << e.what() <<
|
||||
" in function " << __func__;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Shard::open(Scheduler& scheduler, nudb::context& ctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user