aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-12-02 09:25:13 +0100
committerChristian Grothoff <christian@grothoff.org>2024-12-02 09:25:13 +0100
commit41f2a7bfcb35cdf763b9af12dbb15d07733b6b33 (patch)
treef635a5fcbf3226dc4c08cf8fe1c02beb68f8f0bf
parenta2e6e886065ccab077046a562b18595932c97290 (diff)
persist interactive successor measure triggered during aggregation
-rw-r--r--src/exchange/taler-exchange-aggregator.c34
-rw-r--r--src/exchange/taler-exchange-httpd_common_kyc.c2
2 files changed, 36 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index 6d558f144..fbc6aac41 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -791,6 +791,40 @@ run_measure (
"Fallback measure %s involves check %s, blocking aggregation\n",
m->measure_name,
m->check_name);
+ {
+ /* persist measure */
+ bool unknown_account;
+ struct GNUNET_TIME_Timestamp last_date;
+ json_t *succ_jmeasures = TALER_KYCLOGIC_get_jmeasures (
+ lrs,
+ m->measure_name);
+ enum GNUNET_DB_QueryStatus qs;
+
+ qs = db_plugin->insert_successor_measure (
+ db_plugin->cls,
+ &au->h_normalized_payto,
+ GNUNET_TIME_timestamp_get (),
+ m->measure_name,
+ succ_jmeasures,
+ &unknown_account,
+ &last_date);
+ json_decref (succ_jmeasures);
+ switch (qs)
+ {
+ case GNUNET_DB_STATUS_SOFT_ERROR:
+ GNUNET_log (
+ GNUNET_ERROR_TYPE_INFO,
+ "Serialization issue during aggregation; trying again later!\n");
+ rollback_aggregation (au);
+ return;
+ case GNUNET_DB_STATUS_HARD_ERROR:
+ GNUNET_break (0);
+ fail_aggregation (au);
+ return;
+ default:
+ break;
+ }
+ }
TALER_KYCLOGIC_rules_free (lrs);
commit_to_transient (au);
}
diff --git a/src/exchange/taler-exchange-httpd_common_kyc.c b/src/exchange/taler-exchange-httpd_common_kyc.c
index 38a6d7aba..8e0f6033d 100644
--- a/src/exchange/taler-exchange-httpd_common_kyc.c
+++ b/src/exchange/taler-exchange-httpd_common_kyc.c
@@ -1338,6 +1338,8 @@ legitimization_check_run (
/* FIXME(fdold, 2024-11-08): We are doing the same logic
here and in kyc-info, abstract it out? */
+ /* FIXME(cg-2024-12-02): Also some duplication with
+ code around run_measure in taler-exchange-aggregator! */
/* Check if ruleset is expired and we need to run the successor measure */
if (NULL != lrs)