fix taler-auditor-sync: needs two plugins running in parallel with their own prepare counters
This commit is contained in:
parent
c4bbc4ac56
commit
cedcde4939
@ -392,7 +392,7 @@ do_sync (void *cls)
|
|||||||
* @param value actual value of the option (a string)
|
* @param value actual value of the option (a string)
|
||||||
* @return #GNUNET_OK
|
* @return #GNUNET_OK
|
||||||
*/
|
*/
|
||||||
static int
|
static enum GNUNET_GenericReturnValue
|
||||||
set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
|
set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
|
||||||
void *scls,
|
void *scls,
|
||||||
const char *option,
|
const char *option,
|
||||||
|
@ -62,6 +62,9 @@ function check_with_database()
|
|||||||
psql -Aqt talercheck-in -q -1 -f $1.sql >/dev/null || exit_skip "Failed to load database"
|
psql -Aqt talercheck-in -q -1 -f $1.sql >/dev/null || exit_skip "Failed to load database"
|
||||||
|
|
||||||
echo -n "."
|
echo -n "."
|
||||||
|
echo "Please run:"
|
||||||
|
echo "taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t"
|
||||||
|
bash
|
||||||
taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t
|
taler-auditor-sync -s test-sync-in.conf -d test-sync-out.conf -t
|
||||||
|
|
||||||
# cs_nonce_locks excluded: no point
|
# cs_nonce_locks excluded: no point
|
||||||
|
@ -108,9 +108,19 @@ struct PostgresClosure
|
|||||||
*/
|
*/
|
||||||
#define PREPARE(pg,name,sql) \
|
#define PREPARE(pg,name,sql) \
|
||||||
do { \
|
do { \
|
||||||
static unsigned long long prep_cnt; \
|
static struct { \
|
||||||
|
unsigned long long cnt; \
|
||||||
|
struct PostgresClosure *pg; \
|
||||||
|
} preps[2]; /* 2 ctrs for taler-auditor-sync*/ \
|
||||||
|
unsigned int off = 0; \
|
||||||
\
|
\
|
||||||
if (prep_cnt < pg->prep_gen) \
|
while ( (NULL != preps[off].pg) && \
|
||||||
|
(pg != preps[off].pg) && \
|
||||||
|
(off < sizeof(preps) / sizeof(*preps)) ) \
|
||||||
|
off++; \
|
||||||
|
GNUNET_assert (off < \
|
||||||
|
sizeof(preps) / sizeof(*preps)); \
|
||||||
|
if (preps[off].cnt < pg->prep_gen) \
|
||||||
{ \
|
{ \
|
||||||
struct GNUNET_PQ_PreparedStatement ps[] = { \
|
struct GNUNET_PQ_PreparedStatement ps[] = { \
|
||||||
GNUNET_PQ_make_prepare (name, sql), \
|
GNUNET_PQ_make_prepare (name, sql), \
|
||||||
@ -124,7 +134,8 @@ struct PostgresClosure
|
|||||||
GNUNET_break (0); \
|
GNUNET_break (0); \
|
||||||
return GNUNET_DB_STATUS_HARD_ERROR; \
|
return GNUNET_DB_STATUS_HARD_ERROR; \
|
||||||
} \
|
} \
|
||||||
prep_cnt = pg->prep_gen; \
|
preps[off].pg = pg; \
|
||||||
|
preps[off].cnt = pg->prep_gen; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user