Skip to content

Commit

Permalink
Adjust network ongoing cleanup period
Browse files Browse the repository at this point in the history
Use lower value for dev network to speed up timeout unit tests
  • Loading branch information
pwojcikdev committed Nov 10, 2022
1 parent 1f22c15 commit 5440b5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nano/node/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ void nano::network::ongoing_cleanup ()
{
cleanup (std::chrono::steady_clock::now () - node.network_params.network.cleanup_cutoff ());
std::weak_ptr<nano::node> node_w (node.shared ());
node.workers.add_timed_task (std::chrono::steady_clock::now () + std::chrono::seconds (1), [node_w] () {
node.workers.add_timed_task (std::chrono::steady_clock::now () + std::chrono::seconds (node.network_params.network.is_dev_network () ? 1 : 5), [node_w] () {
if (auto node_l = node_w.lock ())
{
node_l->network.ongoing_cleanup ();
Expand Down
2 changes: 1 addition & 1 deletion nano/node/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void nano::socket::set_last_receive_time ()
void nano::socket::checkup ()
{
std::weak_ptr<nano::socket> this_w (shared_from_this ());
node.workers.add_timed_task (std::chrono::steady_clock::now () + std::chrono::seconds (2), [this_w] () {
node.workers.add_timed_task (std::chrono::steady_clock::now () + std::chrono::seconds (node.network_params.network.is_dev_network () ? 1 : 5), [this_w] () {
if (auto this_l = this_w.lock ())
{
// If the socket is already dead, close just in case, and stop doing checkups
Expand Down

0 comments on commit 5440b5b

Please sign in to comment.