diff options
author | Florian Dold <florian@dold.me> | 2024-01-13 14:41:49 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-01-13 14:41:49 +0100 |
commit | 2be9142ac5f944fbc03186b22ca67e6020187c92 (patch) | |
tree | b2d06726b434260ee31483e2ac2b2b61d64c5fb6 /packages | |
parent | 3277caa38a693e7faae588133d2604cd7072295a (diff) | |
download | wallet-core-2be9142ac5f944fbc03186b22ca67e6020187c92.tar.xz |
-also allow fetching
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 8d5028d47..1fa1d117e 100644 --- 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}`); |