mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Ugly workaround for Boost I/O service weirdness. I/O service unconditionally
terminates if it has no work to do and cannot be used to wait around for 'post' calls.
This commit is contained in:
@@ -35,8 +35,14 @@ DatabaseCon::~DatabaseCon()
|
||||
delete mDatabase;
|
||||
}
|
||||
|
||||
static void resetTimer(boost::asio::deadline_timer* timer)
|
||||
{ // ugly workaround for Boost IO service weirdness
|
||||
timer->expires_from_now(boost::posix_time::hours(24));
|
||||
timer->async_wait(boost::bind(resetTimer, timer));
|
||||
}
|
||||
|
||||
Application::Application() :
|
||||
mUNL(mIOService),
|
||||
mIOTimer(mIOService), mAuxTimer(mAuxService), mUNL(mIOService),
|
||||
mNetOps(mIOService, &mMasterLedger), mTempNodeCache(16384, 90), mHashedObjectStore(16384, 300),
|
||||
mSNTPClient(mAuxService), mRpcDB(NULL), mTxnDB(NULL), mLedgerDB(NULL), mWalletDB(NULL),
|
||||
mHashNodeDB(NULL), mNetNodeDB(NULL),
|
||||
@@ -44,6 +50,9 @@ Application::Application() :
|
||||
{
|
||||
RAND_bytes(mNonce256.begin(), mNonce256.size());
|
||||
RAND_bytes(reinterpret_cast<unsigned char *>(&mNonceST), sizeof(mNonceST));
|
||||
|
||||
resetTimer(&mIOTimer);
|
||||
resetTimer(&mAuxTimer);
|
||||
}
|
||||
|
||||
extern const char *RpcDBInit[], *TxnDBInit[], *LedgerDBInit[], *WalletDBInit[], *HashNodeDBInit[], *NetNodeDBInit[];
|
||||
|
||||
Reference in New Issue
Block a user