mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-29 10:00:30 +00:00
Delay HTTPDownloader dtor until current session finishes
This commit is contained in:
@@ -102,8 +102,8 @@ ShardArchiveHandler::init()
|
||||
if (exists(downloadDir_ / stateDBName) &&
|
||||
is_regular_file(downloadDir_ / stateDBName))
|
||||
{
|
||||
downloader_.reset(
|
||||
new DatabaseDownloader(app_.getIOService(), j_, app_.config()));
|
||||
downloader_ =
|
||||
make_DatabaseDownloader(app_.getIOService(), app_.config(), j_);
|
||||
|
||||
return initFromDB(lock);
|
||||
}
|
||||
@@ -283,8 +283,8 @@ ShardArchiveHandler::start()
|
||||
if (!downloader_)
|
||||
{
|
||||
// will throw if can't initialize ssl context
|
||||
downloader_ = std::make_unique<DatabaseDownloader>(
|
||||
app_.getIOService(), j_, app_.config());
|
||||
downloader_ =
|
||||
make_DatabaseDownloader(app_.getIOService(), app_.config(), j_);
|
||||
}
|
||||
}
|
||||
catch (std::exception const& e)
|
||||
@@ -307,15 +307,15 @@ ShardArchiveHandler::release()
|
||||
bool
|
||||
ShardArchiveHandler::next(std::lock_guard<std::mutex> const& l)
|
||||
{
|
||||
if (isStopping())
|
||||
return false;
|
||||
|
||||
if (archives_.empty())
|
||||
{
|
||||
doRelease(l);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isStopping())
|
||||
return false;
|
||||
|
||||
auto const shardIndex{archives_.begin()->first};
|
||||
|
||||
// We use the sequence of the last validated ledger
|
||||
|
||||
Reference in New Issue
Block a user