mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
log: make m_limiter a shared_ptr
This allows us to safely and explicitly manage the dual dependency on the limiter: one for the Logger, and one for the CScheduler. Github-Pull: #33011 Rebased-From: 3d630c2544e19480268426cda245796d4ce34ac3
This commit is contained in:
parent
81751341e9
commit
acfa83d9d0
4 changed files with 26 additions and 12 deletions
|
|
@ -1384,7 +1384,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
}
|
||||
}, std::chrono::minutes{5});
|
||||
|
||||
LogInstance().SetRateLimiting(std::make_unique<BCLog::LogRateLimiter>(
|
||||
LogInstance().SetRateLimiting(BCLog::LogRateLimiter::Create(
|
||||
[&scheduler](auto func, auto window) { scheduler.scheduleEvery(std::move(func), window); },
|
||||
BCLog::RATELIMIT_MAX_BYTES,
|
||||
BCLog::RATELIMIT_WINDOW));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue