diff options
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c index c1335ff5d..9c1948599 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1049,6 +1049,7 @@ run_scheduled_events(time_t now) static time_t time_to_write_stats_files = 0; static time_t time_to_write_bridge_stats = 0; static time_t time_to_check_port_forwarding = 0; + static time_t time_to_launch_reachability_tests = 0; static int should_init_bridge_stats = 1; static time_t time_to_retry_dns_init = 0; static time_t time_to_next_heartbeat = 0; @@ -1151,8 +1152,10 @@ run_scheduled_events(time_t now) if (accounting_is_enabled(options)) accounting_run_housekeeping(now); - if (now % 10 == 0 && (authdir_mode_tests_reachability(options)) && - !we_are_hibernating()) { + if (time_to_launch_reachability_tests < now && + (authdir_mode_tests_reachability(options)) && + !we_are_hibernating()) { + time_to_launch_reachability_tests = now + REACHABILITY_TEST_INTERVAL; /* try to determine reachability of the other Tor relays */ dirserv_test_reachability(now); } |