diff options
Diffstat (limited to 'src/exchange-tools/taler-exchange-dbinit.c')
-rw-r--r-- | src/exchange-tools/taler-exchange-dbinit.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c index 5e18549e7..b187cff33 100644 --- a/src/exchange-tools/taler-exchange-dbinit.c +++ b/src/exchange-tools/taler-exchange-dbinit.c @@ -89,20 +89,33 @@ run (void *cls, global_ret = EXIT_NOPERMISSION; return; } - if (clear_shards) + if (gc_db || clear_shards) { - if (0 < plugin->delete_revolving_shards (plugin->cls)) + if (GNUNET_OK != + plugin->preflight (plugin->cls)) { fprintf (stderr, - "Clearing revolving shards failed!\n"); + "Failed to prepare database.\n"); + TALER_EXCHANGEDB_plugin_unload (plugin); + global_ret = EXIT_NOPERMISSION; + return; } - } - if (gc_db) - { - if (GNUNET_SYSERR == plugin->gc (plugin->cls)) + if (clear_shards) { - fprintf (stderr, - "Garbage collection failed!\n"); + if (0 > + plugin->delete_revolving_shards (plugin->cls)) + { + fprintf (stderr, + "Clearing revolving shards failed!\n"); + } + } + if (gc_db) + { + if (GNUNET_SYSERR == plugin->gc (plugin->cls)) + { + fprintf (stderr, + "Garbage collection failed!\n"); + } } } TALER_EXCHANGEDB_plugin_unload (plugin); |