summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-wirewatch.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-13 10:51:45 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-13 10:51:45 +0100
commitcaaa90d3d8b9f14998c856ab1b023c171a479b7a (patch)
tree0d4103dbdd29983c7d39c99919eebe4de61e9b2a /src/exchange/taler-exchange-wirewatch.c
parent0ac0344d84674853710654c7811e1f84d7944fb1 (diff)
downloadexchange-caaa90d3d8b9f14998c856ab1b023c171a479b7a.tar.gz
exchange-caaa90d3d8b9f14998c856ab1b023c171a479b7a.tar.bz2
exchange-caaa90d3d8b9f14998c856ab1b023c171a479b7a.zip
-make LP delay configurable
Diffstat (limited to 'src/exchange/taler-exchange-wirewatch.c')
-rw-r--r--src/exchange/taler-exchange-wirewatch.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
index 5ac518298..cad6b7d01 100644
--- a/src/exchange/taler-exchange-wirewatch.c
+++ b/src/exchange/taler-exchange-wirewatch.c
@@ -106,6 +106,12 @@ static struct GNUNET_TIME_Absolute shard_end_time;
static struct GNUNET_TIME_Relative shard_delay;
/**
+ * How long did we take to finish the last shard
+ * for this account?
+ */
+static struct GNUNET_TIME_Relative longpoll_timeout;
+
+/**
* Name of our job in the shard table.
*/
static char *job_name;
@@ -474,7 +480,7 @@ transaction_completed (void)
struct GNUNET_TIME_Relative left;
latency = GNUNET_TIME_absolute_get_duration (hh_start_time);
- left = GNUNET_TIME_relative_subtract (LONGPOLL_TIMEOUT,
+ left = GNUNET_TIME_relative_subtract (longpoll_timeout,
latency);
delayed_until = GNUNET_TIME_relative_to_absolute (left);
}
@@ -1157,7 +1163,7 @@ continue_with_shard (void *cls)
limit,
test_mode
? GNUNET_TIME_UNIT_ZERO
- : LONGPOLL_TIMEOUT,
+ : longpoll_timeout,
&history_cb,
NULL);
if (NULL == hh)
@@ -1365,6 +1371,11 @@ main (int argc,
"exit-on-error",
"terminate wirewatch if we failed to download information from the bank",
&exit_on_error),
+ GNUNET_GETOPT_option_relative_time ('f',
+ "longpoll-timeout",
+ "DELAY"
+ "what is the timeout when asking the bank about new transactions",
+ &longpoll_timeout),
GNUNET_GETOPT_option_flag ('I',
"ignore-not-found",
"continue, even if the bank account of the exchange was not found",
@@ -1390,6 +1401,7 @@ main (int argc,
};
enum GNUNET_GenericReturnValue ret;
+ longpoll_timeout = LONGPOLL_TIMEOUT;
if (GNUNET_OK !=
GNUNET_STRINGS_get_utf8_args (argc, argv,
&argc, &argv))