[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-donau] branch master updated: [db] some changes
From: |
gnunet |
Subject: |
[taler-donau] branch master updated: [db] some changes |
Date: |
Mon, 08 Jan 2024 10:54:23 +0100 |
This is an automated email from the git hooks/post-receive script.
johannes-casaburi pushed a commit to branch master
in repository donau.
The following commit(s) were added to refs/heads/master by this push:
new 13bd068 [db] some changes
13bd068 is described below
commit 13bd0680674dbf75963ff9894e70b06096d05716
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
AuthorDate: Mon Jan 8 10:53:51 2024 +0100
[db] some changes
---
src/donau-tools/donau-dbinit.c | 52 +++++++++++++++++------------------
src/donau/donau-httpd.c | 7 +++++
src/donau/donau-httpd_db.c | 2 +-
src/donaudb/donaudb-postgres.conf | 3 --
src/donaudb/donaudb.conf | 31 ---------------------
src/donaudb/donaudb_plugin.c | 5 ++--
src/donaudb/plugin_donaudb_postgres.c | 4 +--
src/include/donaudb_plugin.h | 12 ++++++++
8 files changed, 50 insertions(+), 66 deletions(-)
diff --git a/src/donau-tools/donau-dbinit.c b/src/donau-tools/donau-dbinit.c
index a74278c..b29691b 100644
--- a/src/donau-tools/donau-dbinit.c
+++ b/src/donau-tools/donau-dbinit.c
@@ -118,21 +118,21 @@ run (void *cls,
}
// if (clear_shards)
// {
- // if (GNUNET_OK !=
- // plugin->delete_shard_locks (plugin->cls))
- // {
- // fprintf (stderr,
- // "Clearing revolving shards failed!\n");
- // }
- // }
- // if (gc_db)
+ // if (GNUNET_OK !=
+ // plugin->delete_shard_locks (plugin->cls))
// {
- // if (GNUNET_SYSERR == plugin->gc (plugin->cls))
- // {
- // fprintf (stderr,
- // "Garbage collection failed!\n");
- // }
+ // fprintf (stderr,
+ // "Clearing revolving shards failed!\n");
+ // }
// }
+ if (gc_db)
+ {
+ if (GNUNET_SYSERR == plugin->gc (plugin->cls))
+ {
+ fprintf (stderr,
+ "Garbage collection failed!\n");
+ }
+ }
}
DONAUDB_plugin_unload (plugin);
plugin = NULL;
@@ -160,19 +160,19 @@ main (int argc,
"reset",
"reset database (DANGEROUS: all existing data
is lost!)",
&reset_db),
- GNUNET_GETOPT_option_flag ('s',
- "shardunlock",
- "unlock all revolving shard locks (use after
system crash or shard size change while services are not running)",
- &clear_shards),
- GNUNET_GETOPT_option_uint ('P',
- "partition",
- "NUMBER",
- "Setup a partitioned database where each table
which can be partitioned holds NUMBER partitions on a single DB node",
- &num_partitions),
- GNUNET_GETOPT_option_flag ('f',
- "force",
- "Force partitions to be created if there is
only one partition",
- &force_create_partitions),
+ // GNUNET_GETOPT_option_flag ('s',
+ // "shardunlock",
+ // "unlock all revolving shard locks (use after
system crash or shard size change while services are not running)",
+ // &clear_shards),
+ // GNUNET_GETOPT_option_uint ('P',
+ // "partition",
+ // "NUMBER",
+ // "Setup a partitioned database where each
table which can be partitioned holds NUMBER partitions on a single DB node",
+ // &num_partitions),
+ // GNUNET_GETOPT_option_flag ('f',
+ // "force",
+ // "Force partitions to be created if there is
only one partition",
+ // &force_create_partitions),
GNUNET_GETOPT_OPTION_END
};
enum GNUNET_GenericReturnValue ret;
diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c
index 8ce6ec8..071c9df 100644
--- a/src/donau/donau-httpd.c
+++ b/src/donau/donau-httpd.c
@@ -439,6 +439,13 @@ handle_mhd_request (void *cls,
.method = MHD_HTTP_METHOD_GET,
.handler.get = &DH_handler_charities_get
},
+ /* GET charity */
+ {
+ .url = "charity",
+ .method = MHD_HTTP_METHOD_GET,
+ .handler.get = &DH_handler_charity_get,
+ .nargs = 1
+ },
/**
etc
diff --git a/src/donau/donau-httpd_db.c b/src/donau/donau-httpd_db.c
index 5073edd..fcd55d6 100644
--- a/src/donau/donau-httpd_db.c
+++ b/src/donau/donau-httpd_db.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2017, 2021 Taler Systems SA
+ Copyright (C) 2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
diff --git a/src/donaudb/donaudb-postgres.conf
b/src/donaudb/donaudb-postgres.conf
index daf9c47..92ba398 100644
--- a/src/donaudb/donaudb-postgres.conf
+++ b/src/donaudb/donaudb-postgres.conf
@@ -4,6 +4,3 @@ CONFIG = "postgres:///taler"
# Where are the SQL files to setup our tables?
# Important: this MUST end with a "/"!
SQL_DIR = $DATADIR/sql/donau/
-
-# Number of purses per account by default.
-DEFAULT_PURSE_LIMIT = 1
\ No newline at end of file
diff --git a/src/donaudb/donaudb.conf b/src/donaudb/donaudb.conf
index 663755e..082123c 100644
--- a/src/donaudb/donaudb.conf
+++ b/src/donaudb/donaudb.conf
@@ -3,34 +3,3 @@
# Database-backend independent specification for the donaudb module.
#
[donaudb]
-# Where do we expect to find information about auditors?
-AUDITOR_BASE_DIR = ${TALER_DATA_HOME}/auditors/
-
-# Where do we expect to find information about wire transfer fees
-# for aggregate payments? These are the amounts we charge (subtract)
-# the charity per wire transfer. The directory is expected to
-# contain files "$METHOD.fee" with the cost structure, where
-# $METHOD corresponds to a wire transfer method.
-WIREFEE_BASE_DIR = ${TALER_DATA_HOME}/donau/wirefees/
-
-
-# After how long do we close idle reserves? The donau
-# and the auditor must agree on this value. We currently
-# expect it to be globally defined for the whole system,
-# as there is no way for wallets to query this value. Thus,
-# it is only configurable for testing, and should be treated
-# as constant in production.
-IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
-
-
-# After how long do we forget about reserves? Should be above
-# the legal expiration timeframe of withdrawn coins.
-LEGAL_RESERVE_EXPIRATION_TIME = 7 years
-
-# What is the desired delay between a transaction being ready and the
-# aggregator triggering on it?
-AGGREGATOR_SHIFT = 1 s
-
-# How many concurrent purses may be opened by a reserve
-# if the reserve is paid for a year?
-DEFAULT_PURSE_LIMIT = 1
\ No newline at end of file
diff --git a/src/donaudb/donaudb_plugin.c b/src/donaudb/donaudb_plugin.c
index 49eaf8b..ec325a9 100644
--- a/src/donaudb/donaudb_plugin.c
+++ b/src/donaudb/donaudb_plugin.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2015 Taler Systems SA
+ Copyright (C) 2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -16,8 +16,7 @@
/**
* @file donaudb/donaudb_plugin.c
* @brief Logic to load database plugin
- * @author Christian Grothoff
- * @author Sree Harsha Totakura <sreeharsha@totakura.in>
+ * @author Johannes Casaburi
*/
#include "taler/platform.h"
#include "donaudb_plugin.h"
diff --git a/src/donaudb/plugin_donaudb_postgres.c
b/src/donaudb/plugin_donaudb_postgres.c
index 16cde5a..93dc16c 100644
--- a/src/donaudb/plugin_donaudb_postgres.c
+++ b/src/donaudb/plugin_donaudb_postgres.c
@@ -118,8 +118,8 @@ DH_PG_internal_setup (struct PostgresClosure *pg)
pg->prep_gen++;
pg->conn = db_conn;
}
- // if (NULL == pg->transaction_name)
- // GNUNET_PQ_reconnect_if_down (pg->conn);
+ if (NULL == pg->transaction_name)
+ GNUNET_PQ_reconnect_if_down (pg->conn);
return GNUNET_OK;
}
diff --git a/src/include/donaudb_plugin.h b/src/include/donaudb_plugin.h
index 56d4848..6543e6d 100644
--- a/src/include/donaudb_plugin.h
+++ b/src/include/donaudb_plugin.h
@@ -284,6 +284,18 @@ struct DONAUDB_Plugin
(*rollback) (void *cls);
+ /**
+ * Function called to perform "garbage collection" on the
+ * database, expiring records we no longer require.
+ *
+ * @param cls closure
+ * @return #GNUNET_OK on success,
+ * #GNUNET_SYSERR on DB errors
+ */
+ enum GNUNET_GenericReturnValue
+ (*gc)(void *cls);
+
+
/**
* Register callback to be invoked on events of type @a es.
*
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-donau] branch master updated: [db] some changes,
gnunet <=