aboutsummaryrefslogtreecommitdiff
path: root/src/stasis/plugin_anastasis_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stasis/plugin_anastasis_postgres.c')
-rw-r--r--src/stasis/plugin_anastasis_postgres.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c
index 4271f53..b7fda3d 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -230,6 +230,7 @@ commit_transaction (void *cls)
230 * 230 *
231 * @param cls database context to use 231 * @param cls database context to use
232 * @param es specification of the event to listen for 232 * @param es specification of the event to listen for
233 * @param timeout how long to wait for the event
233 * @param cb function to call when the event happens, possibly 234 * @param cb function to call when the event happens, possibly
234 * multiple times (until cancel is invoked) 235 * multiple times (until cancel is invoked)
235 * @param cb_cls closure for @a cb 236 * @param cb_cls closure for @a cb
@@ -238,6 +239,7 @@ commit_transaction (void *cls)
238static struct GNUNET_DB_EventHandler * 239static struct GNUNET_DB_EventHandler *
239postgres_event_listen (void *cls, 240postgres_event_listen (void *cls,
240 const struct GNUNET_DB_EventHeaderP *es, 241 const struct GNUNET_DB_EventHeaderP *es,
242 struct GNUNET_TIME_Relative timeout,
241 GNUNET_DB_EventCallback cb, 243 GNUNET_DB_EventCallback cb,
242 void *cb_cls) 244 void *cb_cls)
243{ 245{
@@ -245,6 +247,7 @@ postgres_event_listen (void *cls,
245 247
246 return GNUNET_PQ_event_listen (pg->conn, 248 return GNUNET_PQ_event_listen (pg->conn,
247 es, 249 es,
250 timeout,
248 cb, 251 cb,
249 cb_cls); 252 cb_cls);
250} 253}
@@ -2635,7 +2638,6 @@ libanastasis_plugin_db_postgres_init (void *cls)
2635 GNUNET_free (pg); 2638 GNUNET_free (pg);
2636 return NULL; 2639 return NULL;
2637 } 2640 }
2638 GNUNET_PQ_event_scheduler_start (pg->conn);
2639 plugin = GNUNET_new (struct ANASTASIS_DatabasePlugin); 2641 plugin = GNUNET_new (struct ANASTASIS_DatabasePlugin);
2640 plugin->cls = pg; 2642 plugin->cls = pg;
2641 plugin->drop_tables = &postgres_drop_tables; 2643 plugin->drop_tables = &postgres_drop_tables;
@@ -2694,7 +2696,6 @@ libanastasis_plugin_db_postgres_done (void *cls)
2694 struct ANASTASIS_DatabasePlugin *plugin = cls; 2696 struct ANASTASIS_DatabasePlugin *plugin = cls;
2695 struct PostgresClosure *pg = plugin->cls; 2697 struct PostgresClosure *pg = plugin->cls;
2696 2698
2697 GNUNET_PQ_event_scheduler_stop (pg->conn);
2698 GNUNET_PQ_disconnect (pg->conn); 2699 GNUNET_PQ_disconnect (pg->conn);
2699 GNUNET_free (pg->currency); 2700 GNUNET_free (pg->currency);
2700 GNUNET_free (pg); 2701 GNUNET_free (pg);