aboutsummaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_exchanges.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-11-15 15:42:12 +0100
committerChristian Grothoff <christian@grothoff.org>2023-11-15 15:42:12 +0100
commitf848f7ac5c4fbfca456d3f374bdfc642da08951c (patch)
tree46acfde51824c2b5091af79efefef8e0ac68c53c /src/backend/taler-merchant-httpd_exchanges.c
parent42cf0fab2bcfad2d41c9c8f1ecf1863b1e925513 (diff)
-fix wallet-balance integration test: do return immediately even if force-reload is set if we'd otherwise just delay re-fetching /keys and do nothing
Diffstat (limited to 'src/backend/taler-merchant-httpd_exchanges.c')
-rw-r--r--src/backend/taler-merchant-httpd_exchanges.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c
index c9b6cc70..8a89235a 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -859,18 +859,6 @@ TMH_EXCHANGES_keys4exchange (
fo);
return fo;
}
- if ( (NULL == exchange->retry_task) &&
- (NULL == exchange->conn) )
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "No valid keys, fetching /keys at %s\n",
- GNUNET_TIME_absolute2s (exchange->first_retry));
- exchange->retry_task
- = GNUNET_SCHEDULER_add_at (exchange->first_retry,
- &retry_exchange,
- exchange);
- return fo;
- }
if ( (NULL == exchange->conn) &&
( (ESTATE_FAILED == exchange->state) ||
(ESTATE_REDOWNLOADING_FAILURE == exchange->state) ) )
@@ -883,6 +871,22 @@ TMH_EXCHANGES_keys4exchange (
fo);
return fo;
}
+ if ( (force_download) &&
+ (GNUNET_TIME_absolute_is_future (exchange->first_retry)) &&
+ (ESTATE_DOWNLOADED == exchange->state) )
+ {
+ /* Return results immediately. */
+ fo->at = GNUNET_SCHEDULER_add_now (&return_keys,
+ fo);
+ /* *no* return here, we MAY schedule a 'retry_task' in the
+ next block if there isn't one yet */
+ }
+ if ( (NULL == exchange->retry_task) &&
+ (NULL == exchange->conn) )
+ exchange->retry_task
+ = GNUNET_SCHEDULER_add_at (exchange->first_retry,
+ &retry_exchange,
+ exchange);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Next %skeys (%d) request scheduled for %s\n",
exchange->url,