[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: add notification for KYC long po
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: add notification for KYC long pollers on trigger_kyc_rule |
Date: |
Thu, 05 Sep 2024 13:12:49 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new c39040ad2 add notification for KYC long pollers on trigger_kyc_rule
c39040ad2 is described below
commit c39040ad2c4939b21d6ad57240a8a47dbc8f68e3
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Sep 5 13:12:44 2024 +0200
add notification for KYC long pollers on trigger_kyc_rule
---
src/exchangedb/exchange_do_insert_aml_decision.sql | 2 +-
.../exchange_do_trigger_kyc_rule_for_account.sql | 6 ++++++
src/exchangedb/pg_trigger_kyc_rule_for_account.c | 15 +++++++++++++--
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/exchangedb/exchange_do_insert_aml_decision.sql
b/src/exchangedb/exchange_do_insert_aml_decision.sql
index 4c08d5969..ca37e10ff 100644
--- a/src/exchangedb/exchange_do_insert_aml_decision.sql
+++ b/src/exchangedb/exchange_do_insert_aml_decision.sql
@@ -15,7 +15,7 @@
--
DROP FUNCTION IF EXISTS exchange_do_insert_aml_decision;
-CREATE OR REPLACE FUNCTION exchange_do_insert_aml_decision(
+CREATE FUNCTION exchange_do_insert_aml_decision(
IN in_h_payto BYTEA,
IN in_decision_time INT8,
IN in_expiration_time INT8,
diff --git a/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
b/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
index 504b133f3..4ddf57952 100644
--- a/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
+++ b/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql
@@ -24,6 +24,7 @@ CREATE FUNCTION exchange_do_trigger_kyc_rule_for_account(
IN in_now INT8,
IN in_jmeasures TEXT,
IN in_display_priority INT4,
+ IN in_notify_s TEXT,
OUT out_legitimization_measure_serial_id INT8,
OUT out_bad_kyc_auth BOOL)
LANGUAGE plpgsql
@@ -95,4 +96,9 @@ THEN
out_legitimization_measure_serial_id;
END IF;
+EXECUTE FORMAT (
+ 'NOTIFY %s'
+ ,in_notify_s);
+
+
END $$;
diff --git a/src/exchangedb/pg_trigger_kyc_rule_for_account.c
b/src/exchangedb/pg_trigger_kyc_rule_for_account.c
index bc7b81a74..e6f5ffcf9 100644
--- a/src/exchangedb/pg_trigger_kyc_rule_for_account.c
+++ b/src/exchangedb/pg_trigger_kyc_rule_for_account.c
@@ -41,6 +41,13 @@ TEH_PG_trigger_kyc_rule_for_account (
struct PostgresClosure *pg = cls;
struct GNUNET_TIME_Absolute now
= GNUNET_TIME_absolute_get ();
+ struct TALER_KycCompletedEventP rep = {
+ .header.size = htons (sizeof (rep)),
+ .header.type = htons (TALER_DBEVENT_EXCHANGE_KYC_COMPLETED),
+ .h_payto = *h_payto
+ };
+ char *notify_str
+ = GNUNET_PQ_get_event_notify_channel (&rep.header);
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (h_payto),
NULL == set_account_pub
@@ -55,6 +62,7 @@ TEH_PG_trigger_kyc_rule_for_account (
GNUNET_PQ_query_param_absolute_time (&now),
TALER_PQ_query_param_json (jmeasures),
GNUNET_PQ_query_param_uint32 (&display_priority),
+ GNUNET_PQ_query_param_string (notify_str),
GNUNET_PQ_query_param_end
};
struct GNUNET_PQ_ResultSpec rs[] = {
@@ -66,6 +74,7 @@ TEH_PG_trigger_kyc_rule_for_account (
bad_kyc_auth),
GNUNET_PQ_result_spec_end
};
+ enum GNUNET_DB_QueryStatus qs;
PREPARE (pg,
"trigger_kyc_rule_for_account",
@@ -75,11 +84,13 @@ TEH_PG_trigger_kyc_rule_for_account (
" ,out_bad_kyc_auth"
" AS bad_kyc_auth"
" FROM exchange_do_trigger_kyc_rule_for_account"
- "($1, $2, $3, $4, $5, $6, $7);");
+ "($1, $2, $3, $4, $5, $6, $7, $8);");
- return GNUNET_PQ_eval_prepared_singleton_select (
+ qs = GNUNET_PQ_eval_prepared_singleton_select (
pg->conn,
"trigger_kyc_rule_for_account",
params,
rs);
+ GNUNET_free (notify_str);
+ return qs;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: add notification for KYC long pollers on trigger_kyc_rule,
gnunet <=