summaryrefslogtreecommitdiff
path: root/src/exchange-tools/taler-exchange-dbinit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-31 09:16:09 +0200
committerChristian Grothoff <christian@grothoff.org>2016-05-31 09:16:09 +0200
commitba0146b8789d33afee9c3644ad7dade5b99ae1ba (patch)
tree7766002188b89de288dbe0b082347dfe98a1b767 /src/exchange-tools/taler-exchange-dbinit.c
parent94e167995537015f5100b526791cd51268aa0f2f (diff)
downloadexchange-ba0146b8789d33afee9c3644ad7dade5b99ae1ba.tar.gz
exchange-ba0146b8789d33afee9c3644ad7dade5b99ae1ba.tar.bz2
exchange-ba0146b8789d33afee9c3644ad7dade5b99ae1ba.zip
add -g option to taler-exchange-dbinit
Diffstat (limited to 'src/exchange-tools/taler-exchange-dbinit.c')
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c14
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
};