summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-06-20 16:41:04 +0200
committerChristian Grothoff <christian@grothoff.org>2021-06-20 16:41:04 +0200
commit108bf57d048a135cb71f9453540c9d6579ae2028 (patch)
tree6a67bbcf7cb1ab049a5d9ba426e878b1b493dd10 /src/exchange
parent0271e848138a94e27f472196f5341879fd3ab8ba (diff)
downloadexchange-108bf57d048a135cb71f9453540c9d6579ae2028.tar.gz
exchange-108bf57d048a135cb71f9453540c9d6579ae2028.tar.bz2
exchange-108bf57d048a135cb71f9453540c9d6579ae2028.zip
preparations for sharded wirewatch
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-wirewatch.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
index 760dbe10b..28fa81e7e 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -528,8 +528,20 @@ find_transfers (void *cls)
GNUNET_SCHEDULER_shutdown ();
return;
}
+ wa_pos->delay = true;
+ wa_pos->current_batch_size = 0; /* reset counter */
+ wa_pos->session = session;
+ if (wa_pos->shard_end == wa_pos->last_row_off)
+ {
+ /* advance to next shard */
+ // FIXME: if other processes are running in parallel,
+ // update 'last_row_off' to next free shard!
+ wa_pos->shard_end = wa_pos->last_row_off + shard_size;
+ }
if (! wa_pos->reset_mode)
{
+ // FIXME: need good way to fetch
+ // shard data here!
qs = db_plugin->get_latest_reserve_in_reference (db_plugin->cls,
session,
wa_pos->section_name,
@@ -553,16 +565,8 @@ find_transfers (void *cls)
NULL);
return;
}
- wa_pos->reset_mode = GNUNET_NO;
- }
- wa_pos->delay = true;
- wa_pos->current_batch_size = 0; /* reset counter */
- wa_pos->session = session;
- if (wa_pos->shard_end == wa_pos->last_row_off)
- {
- /* advance to next shard */
- wa_pos->shard_end += shard_size;
}
+ wa_pos->reset_mode = true;
limit = GNUNET_MIN (wa_pos->batch_size,
wa_pos->shard_end - wa_pos->last_row_off);
GNUNET_assert (NULL == wa_pos->hh);