gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5158 - GNUnet/src/applications/datastore


From: gnunet
Subject: [GNUnet-SVN] r5158 - GNUnet/src/applications/datastore
Date: Thu, 28 Jun 2007 00:45:07 -0600 (MDT)

Author: grothoff
Date: 2007-06-28 00:45:04 -0600 (Thu, 28 Jun 2007)
New Revision: 5158

Modified:
   GNUnet/src/applications/datastore/datastore.c
   GNUnet/src/applications/datastore/prefetch.c
Log:
move to independent cron job

Modified: GNUnet/src/applications/datastore/datastore.c
===================================================================
--- GNUnet/src/applications/datastore/datastore.c       2007-06-28 06:44:20 UTC 
(rev 5157)
+++ GNUnet/src/applications/datastore/datastore.c       2007-06-28 06:45:04 UTC 
(rev 5158)
@@ -64,6 +64,8 @@
  */
 static unsigned long long quota;
 
+static struct CronManager * cron;
+
 /**
  * Require 1/100th of quota to be 'free' space.
  */
@@ -176,8 +178,8 @@
           "Datastore full (%llu/%llu) and content priority too low to kick out 
other content.  Refusing put.\n",
           sq->getSize(),
           quota);
-    return SYSERR; /* new content has such a low priority that
-                     we should not even bother! */
+    return NO; /* new content has such a low priority that
+                 we should not even bother! */
   }
   if (ntohl(value->prio) < minPriority)
     minPriority = ntohl(value->prio);
@@ -408,11 +410,13 @@
     return NULL;
   }
   available = quota - sq->getSize();
-  cron_add_job(capi->cron,
+  cron = cron_create(capi->ectx);
+  cron_add_job(cron,
               &cronMaintenance,
               10 * cronSECONDS,
               10 * cronSECONDS,
               NULL);
+  cron_start(cron);
   api.getSize = &getSize;
   api.put = &put;
   api.fast_get = &fastGet;
@@ -428,10 +432,13 @@
  * Shutdown the manager module.
  */
 void release_module_datastore() {
-  cron_del_job(coreAPI->cron,
+  cron_stop(cron);
+  cron_del_job(cron,
               &cronMaintenance,
               10 * cronSECONDS,
               NULL);
+  cron_destroy(cron);
+  cron = NULL;
   donePrefetch();
   doneFilters();
   coreAPI->releaseService(sq);

Modified: GNUnet/src/applications/datastore/prefetch.c
===================================================================
--- GNUnet/src/applications/datastore/prefetch.c        2007-06-28 06:44:20 UTC 
(rev 5157)
+++ GNUnet/src/applications/datastore/prefetch.c        2007-06-28 06:45:04 UTC 
(rev 5158)
@@ -91,8 +91,8 @@
                
 
 static int acquire(const HashCode512 * key,
-                 const Datastore_Value * value,
-                 void * closure) {
+                  const Datastore_Value * value,
+                  void * closure) {
   int loadc;
   int loadi;
   int load;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]