commit 2be9142ac5f944fbc03186b22ca67e6020187c92 parent 3277caa38a693e7faae588133d2604cd7072295a Author: Florian Dold <florian@dold.me> Date: Sat, 13 Jan 2024 14:41:49 +0100 -also allow fetching Diffstat:
| M | packages/taler-wallet-core/src/wallet.ts | | | 14 | ++++++++++++++ |
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts @@ -1395,6 +1395,20 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( } case WalletApiOperation.TestingInfiniteTransactionLoop: { const myDelayMs = (payload as any).delayMs ?? 5; + const shouldFetch = !!(payload as any).shouldFetch; + const doFetch = async () => { + while (1) { + const url = + "https://exchange.demo.taler.net/reserves/01PMMB9PJN0QBWAFBXV6R0KNJJMAKXCV4D6FDG0GJFDJQXGYP32G?timeout_ms=30000"; + logger.info(`fetching ${url}`); + const res = await ws.http.fetch(url); + logger.info(`fetch result ${res.status}`); + } + }; + if (shouldFetch) { + // In the background! + doFetch(); + } let loopCount = 0; while (true) { logger.info(`looping test write tx, iteration ${loopCount}`);