summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-aggregator.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-01 12:21:03 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-01 12:21:03 +0100
commiteffa6451a265d0a4d745443e9ee022c3f24e1bb8 (patch)
tree5c87c0791edb54d480bb98a178156d5671fde1d0 /src/exchange/taler-exchange-aggregator.c
parent538ca960a12de721d12b4eac107af61da9765775 (diff)
downloadexchange-effa6451a265d0a4d745443e9ee022c3f24e1bb8.tar.gz
exchange-effa6451a265d0a4d745443e9ee022c3f24e1bb8.tar.bz2
exchange-effa6451a265d0a4d745443e9ee022c3f24e1bb8.zip
fix FIXME
Diffstat (limited to 'src/exchange/taler-exchange-aggregator.c')
-rw-r--r--src/exchange/taler-exchange-aggregator.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/exchange/taler-exchange-aggregator.c b/src/exchange/taler-exchange-aggregator.c
index d380c391..550be55c 100644
--- a/src/exchange/taler-exchange-aggregator.c
+++ b/src/exchange/taler-exchange-aggregator.c
@@ -279,6 +279,11 @@ static struct GNUNET_CURL_Context *ctx;
static struct GNUNET_CURL_RescheduleContext *rc;
/**
+ * How long should we sleep when idle before trying to find more work?
+ */
+static struct GNUNET_TIME_Relative aggreator_idle_sleep_interval;
+
+/**
* Value to return from main(). #GNUNET_OK on success, #GNUNET_SYSERR
* on serious errors.
*/
@@ -624,6 +629,17 @@ parse_wirewatch_config ()
return GNUNET_SYSERR;
}
if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (cfg,
+ "exchange",
+ "AGGREGATOR_IDLE_SLEEP_INTERVAL",
+ &aggregator_idle_sleep_interval))
+ {
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "AGGREGATOR_IDLE_SLEEP_INTERVAL");
+ return GNUNET_SYSERR;
+ }
+ if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cfg,
"taler",
"currency",
@@ -1424,10 +1440,9 @@ run_aggregation (void *cls)
}
else
{
- /* FIXME(dold): We might want to read the duration to sleep from the config */
/* nothing to do, sleep for a minute and try again */
GNUNET_assert (NULL == task);
- task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
+ task = GNUNET_SCHEDULER_add_delayed (aggregator_idle_sleep_interval,
&run_aggregation,
NULL);
}