From ba0146b8789d33afee9c3644ad7dade5b99ae1ba Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 31 May 2016 09:16:09 +0200 Subject: add -g option to taler-exchange-dbinit --- src/exchange-tools/taler-exchange-dbinit.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c index 16d76e4d0..cf768f4ca 100644 --- a/src/exchange-tools/taler-exchange-dbinit.c +++ b/src/exchange-tools/taler-exchange-dbinit.c @@ -33,6 +33,11 @@ static int global_ret; */ static int reset_db; +/** + * -g option: garbage collect DB reset + */ +static int gc_db; + /** * Main function that will be run. * @@ -68,6 +73,12 @@ run (void *cls, global_ret = 1; return; } + if (gc_db) + { + if (GNUNET_SYSERR == plugin->gc (plugin->cls)) + fprintf (stderr, + "Garbage collection failed!\n"); + } TALER_EXCHANGEDB_plugin_unload (plugin); } @@ -88,6 +99,9 @@ main (int argc, {'r', "reset", NULL, "reset database (DANGEROUS: all existing data is lost!)", 0, &GNUNET_GETOPT_set_one, &reset_db}, + {'g', "gc", NULL, + "garbage collect database", 0, + &GNUNET_GETOPT_set_one, &gc_db}, GNUNET_GETOPT_OPTION_END }; -- cgit v1.2.3