Hostlists are now saved to disk regularly
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Apr 2010 10:29:15 +0000 (10:29 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Apr 2010 10:29:15 +0000 (10:29 +0000)
src/hostlist/hostlist-client.c
src/hostlist/hostlist-client.h

index 7370899bd36ee467296c33c3c7b5dbc01a3162e7..a9bddb061c80c3c7494020ae1a304ab4561574cb 100644 (file)
@@ -746,13 +746,6 @@ schedule_hostlist_task ()
                                               NULL);
 }
 
-/**
- * Compute when we should save the hostlist entries the next time;
- * then schedule the task accordingly.
- */
-static void
-schedule_hostlist_saving_task ();
-
 /**
  * Task that checks if we should try to download a hostlist.
  * If so, we initiate the download, otherwise we schedule
@@ -768,19 +761,9 @@ hostlist_saving_task (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               _("Scheduled saving of hostlists\n"));
   save_hostlist_file ( GNUNET_NO );
-  /*schedule_hostlist_saving_task ();*/
-}
-
-/**
- * Compute when we should save the hostlist entries the next time;
- * then schedule the task accordingly.
- */
-static void
-schedule_hostlist_saving_task ()
-{
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              _("Hostlists will be saved to file again in  %llums\n"),
+              _("Hostlists will be saved to file again in %llums\n"),
               (unsigned long long) SAVING_INTERVALL.value);
   saving_task = GNUNET_SCHEDULER_add_delayed (sched,
                                                SAVING_INTERVALL,
@@ -1193,7 +1176,14 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
   linked_list_head = NULL;
   linked_list_tail = NULL;
   load_hostlist_file ();
-  // schedule_hostlist_saving_task ();
+
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              _("Hostlists will be saved to file again in  %llums\n"),
+              (unsigned long long) SAVING_INTERVALL.value);
+  saving_task = GNUNET_SCHEDULER_add_delayed (sched,
+                                               SAVING_INTERVALL,
+                                               &hostlist_saving_task,
+                                               NULL);
 
   GNUNET_STATISTICS_get (stats,
                         "hostlist",
index a147e25cde07c819392e82fc24ef14bd30767936..1e1237a82151f3878937c9fb9fc69e3a651611f6 100644 (file)
@@ -33,7 +33,7 @@
 #include "gnunet_time_lib.h"
 
 #define MAX_NUMBER_HOSTLISTS 30
-#define SAVING_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 5)
+#define SAVING_INTERVALL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30)
 
 /*
  * Defines concerning the hostlist quality metric