Lower request loop min_sleep for tests (#2905)

This commit is contained in:
Guilherme Lawless 2020-09-02 09:34:19 +01:00 committed by GitHub
commit 17d013a932
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,7 +358,7 @@ void nano::active_transactions::request_loop ()
if (!stopped)
{
constexpr auto min_sleep_l = std::chrono::milliseconds (250);
const auto min_sleep_l = std::chrono::milliseconds (node.network_params.network.request_interval_ms / 2);
const auto wakeup_l = std::max (stamp_l + std::chrono::milliseconds (node.network_params.network.request_interval_ms), std::chrono::steady_clock::now () + min_sleep_l);
condition.wait_until (lock, wakeup_l, [&wakeup_l, &stopped = stopped] { return stopped || std::chrono::steady_clock::now () >= wakeup_l; });
}