summaryrefslogtreecommitdiff
path: root/src/exchange-tools/taler-exchange-dbinit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-09-03 21:30:14 +0200
committerChristian Grothoff <christian@grothoff.org>2021-09-03 21:30:14 +0200
commit1c1d28d3f5746fac496b517d0b3b78ca1726f01f (patch)
treefb449f75455b24b37fcb2f41ea0b343c6a1a03d1 /src/exchange-tools/taler-exchange-dbinit.c
parent5149af93147c54055d99af688993de3fb4c36ddf (diff)
downloadexchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.tar.gz
exchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.tar.bz2
exchange-1c1d28d3f5746fac496b517d0b3b78ca1726f01f.zip
first draft for an aggregator benchmark, plus fixing inclusive/exclusive sharding range issues
Diffstat (limited to 'src/exchange-tools/taler-exchange-dbinit.c')
-rw-r--r--src/exchange-tools/taler-exchange-dbinit.c31
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 5e18549e..b187cff3 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);