diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-07 16:55:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-07 16:55:16 +0000 |
commit | b9de10a83f130b2c0a4513a1f713d778fbb4ecc1 (patch) | |
tree | 0dcfa912e2eea217d494ba56f1373e2c0cbb7e26 /src/datastore/perf_plugin_datastore.c | |
parent | d4115af6385dcab2433b27796e777819e297dae7 (diff) |
do not fail if datastore unavailable
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 660f256f9b..17cd009bcd 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c @@ -334,7 +334,13 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' datastore plugin\n"), name); GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); - GNUNET_assert (NULL != (ret = GNUNET_PLUGIN_load (libname, &env))); + if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) + { + fprintf (stderr, + "Failed to load plugin `%s'!\n", + name); + return NULL; + } GNUNET_free (libname); GNUNET_free (name); return ret; @@ -352,15 +358,19 @@ run (void *cls, struct CpsRunContext *crc; api = load_plugin (c, s); - GNUNET_assert (api != NULL); + if (api == NULL) + { + fprintf (stderr, + "Could not initialize plugin, assuming database not configured. Test not run!\n"); + return; + } crc = GNUNET_malloc(sizeof(struct CpsRunContext)); crc->api = api; crc->sched = s; crc->cfg = c; crc->phase = RP_PUT; - GNUNET_SCHEDULER_add_after (s, - GNUNET_SCHEDULER_NO_TASK, - &test, crc); + GNUNET_SCHEDULER_add_now (crc->sched, + &test, crc); } |