[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-sync] branch master updated: implement -g option in sync-dbinit
From: |
gnunet |
Subject: |
[taler-sync] branch master updated: implement -g option in sync-dbinit |
Date: |
Sat, 30 Nov 2019 00:43:09 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository sync.
The following commit(s) were added to refs/heads/master by this push:
new 35dc96a implement -g option in sync-dbinit
35dc96a is described below
commit 35dc96ac784586d0c137a43ff90eea7b7b253d7a
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Nov 30 00:43:06 2019 +0100
implement -g option in sync-dbinit
---
src/syncdb/sync-dbinit.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/src/syncdb/sync-dbinit.c b/src/syncdb/sync-dbinit.c
index be78eb8..95aaeb6 100644
--- a/src/syncdb/sync-dbinit.c
+++ b/src/syncdb/sync-dbinit.c
@@ -34,6 +34,11 @@ static int global_ret;
*/
static int reset_db;
+/**
+ * -g option: do GC reset
+ */
+static int gc_db;
+
/**
* Main function that will be run.
*
@@ -64,6 +69,20 @@ run (void *cls,
SYNC_DB_plugin_unload (plugin);
plugin = SYNC_DB_plugin_load (cfg);
}
+ if (gc_db)
+ {
+ struct GNUNET_TIME_Absolute now;
+ struct GNUNET_TIME_Absolute ancient;
+
+ now = GNUNET_TIME_absolute_get ();
+ ancient = GNUNET_TIME_absolute_subtract (now,
+ GNUNET_TIME_relative_multiply (
+ GNUNET_TIME_UNIT_YEARS,
+ 6));
+ plugin->gc (plugin->cls,
+ now,
+ ancient);
+ }
SYNC_DB_plugin_unload (plugin);
}
@@ -85,6 +104,10 @@ main (int argc,
"reset",
"reset database (DANGEROUS: all existing data
is lost!)",
&reset_db),
+ GNUNET_GETOPT_option_flag ('g',
+ "garbagecollect",
+ "remove state data from database",
+ &gc_db),
GNUNET_GETOPT_OPTION_END
};
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-sync] branch master updated: implement -g option in sync-dbinit,
gnunet <=