exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit ba0146b8789d33afee9c3644ad7dade5b99ae1ba
parent 94e167995537015f5100b526791cd51268aa0f2f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 31 May 2016 09:16:09 +0200

add -g option to taler-exchange-dbinit

Diffstat:
Mdoc/taler-exchange-dbinit.1 | 5++++-
Msrc/exchange-tools/taler-exchange-dbinit.c | 14++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/doc/taler-exchange-dbinit.1 b/doc/taler-exchange-dbinit.1 @@ -1,4 +1,4 @@ -.TH TALER\-EXCHANGE\-DBINIT 1 "Apr 22, 2015" "GNU Taler" +.TH TALER\-EXCHANGE\-DBINIT 1 "May 31, 2016" "GNU Taler" .SH NAME taler\-exchange\-dbinit \- Initialize Taler exchange database. @@ -19,6 +19,9 @@ Use the configuration and other resources for the exchange to operate from DIRNA .IP "\-h, \-\-help" Print short help on options. .B +.IP "\-g, \-\-gc" +Garbage collect database. Deletes all unnecessary data in the database. +.B .IP "\-r, \-\-reset" Drop tables. Dangerous, will delete all existing data in the database before creating the tables. .B diff --git 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 };