diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-31 09:16:09 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-31 09:16:09 +0200 |
commit | ba0146b8789d33afee9c3644ad7dade5b99ae1ba (patch) | |
tree | 7766002188b89de288dbe0b082347dfe98a1b767 /src/exchange-tools | |
parent | 94e167995537015f5100b526791cd51268aa0f2f (diff) | |
download | exchange-ba0146b8789d33afee9c3644ad7dade5b99ae1ba.tar.xz |
add -g option to taler-exchange-dbinit
Diffstat (limited to 'src/exchange-tools')
-rw-r--r-- | src/exchange-tools/taler-exchange-dbinit.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ -34,6 +34,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. * * @param cls closure @@ -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 }; |