allow env override
This commit is contained in:
parent
14436d1241
commit
7d8a74adf1
@ -4297,6 +4297,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
|||||||
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
|
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
|
||||||
struct PostgresClosure *pg;
|
struct PostgresClosure *pg;
|
||||||
struct TALER_EXCHANGEDB_Plugin *plugin;
|
struct TALER_EXCHANGEDB_Plugin *plugin;
|
||||||
|
const char *ec;
|
||||||
|
|
||||||
pg = GNUNET_new (struct PostgresClosure);
|
pg = GNUNET_new (struct PostgresClosure);
|
||||||
|
|
||||||
@ -4307,7 +4308,14 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
|||||||
GNUNET_free (pg);
|
GNUNET_free (pg);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (GNUNET_OK !=
|
ec = getenv ("TALER_EXCHANGEDB_POSTGRES_CONFIG");
|
||||||
|
if (NULL != ec)
|
||||||
|
{
|
||||||
|
pg->connection_cfg_str = GNUNET_strdup (ec);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (GNUNET_OK ==
|
||||||
GNUNET_CONFIGURATION_get_value_string (cfg,
|
GNUNET_CONFIGURATION_get_value_string (cfg,
|
||||||
"exchangedb-postgres",
|
"exchangedb-postgres",
|
||||||
"db_conn_str",
|
"db_conn_str",
|
||||||
@ -4319,6 +4327,7 @@ libtaler_plugin_exchangedb_postgres_init (void *cls)
|
|||||||
GNUNET_free (pg);
|
GNUNET_free (pg);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
plugin = GNUNET_new (struct TALER_EXCHANGEDB_Plugin);
|
plugin = GNUNET_new (struct TALER_EXCHANGEDB_Plugin);
|
||||||
plugin->cls = pg;
|
plugin->cls = pg;
|
||||||
plugin->get_session = &postgres_get_session;
|
plugin->get_session = &postgres_get_session;
|
||||||
|
Loading…
Reference in New Issue
Block a user