|
@@ -845,6 +845,9 @@ run_scheduled_events(time_t now)
|
|
|
static time_t time_to_add_entropy = 0;
|
|
|
static time_t time_to_write_hs_statistics = 0;
|
|
|
static time_t time_to_downrate_stability = 0;
|
|
|
+
|
|
|
+#define SAVE_STABILITY_INTERVAL (10*60)
|
|
|
+ static time_t time_to_save_stability = 0;
|
|
|
or_options_t *options = get_options();
|
|
|
int i;
|
|
|
int have_dir_info;
|
|
@@ -935,6 +938,22 @@ run_scheduled_events(time_t now)
|
|
|
|
|
|
if (time_to_downrate_stability < now)
|
|
|
time_to_downrate_stability = rep_hist_downrate_old_runs(now);
|
|
|
+ if (authdir_mode_tests_reachability(options)) {
|
|
|
+ if (!time_to_save_stability)
|
|
|
+ time_to_save_stability = now + SAVE_STABILITY_INTERVAL;
|
|
|
+ if (time_to_save_stability < now) {
|
|
|
+ size_t len = strlen(options->DataDirectory)+32;
|
|
|
+ char *fn = tor_malloc(len);
|
|
|
+ tor_snprintf(fn, len, "%s"PATH_SEPARATOR"router-stability",
|
|
|
+ options->DataDirectory);
|
|
|
+ if (rep_hist_record_mtbf_data(fn)<0) {
|
|
|
+ log_warn(LD_GENERAL, "Couldn't store mtbf data in %s", fn);
|
|
|
+ }
|
|
|
+ tor_free(fn);
|
|
|
+
|
|
|
+ time_to_save_stability = now + SAVE_STABILITY_INTERVAL;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
* new running-routers list, and/or force-uploading our descriptor
|