diff options
author | Florian Dold <florian@dold.me> | 2024-06-18 19:21:39 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-18 19:21:39 +0200 |
commit | 6ab16c94f55e0ef23271f3211c298fe2d84ba1fa (patch) | |
tree | 0b0e6ac3afdc866e8d94f668f5fa40023643b35a /packages/taler-wallet-core/src/withdraw.ts | |
parent | 3913d0117bd034b5d7467eeed6b10c59dae90ce8 (diff) | |
download | wallet-core-6ab16c94f55e0ef23271f3211c298fe2d84ba1fa.tar.xz |
wallet-core: throttle more long-polling
Diffstat (limited to 'packages/taler-wallet-core/src/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/withdraw.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/withdraw.ts b/packages/taler-wallet-core/src/withdraw.ts index 7ba69d2c1..930aa134b 100644 --- a/packages/taler-wallet-core/src/withdraw.ts +++ b/packages/taler-wallet-core/src/withdraw.ts @@ -824,12 +824,18 @@ async function processWithdrawalGroupDialogProposed( ); url.searchParams.set("old_state", "pending"); - url.searchParams.set("long_poll_ms", "30000"); - const resp = await ctx.wex.http.fetch(url.href, { - method: "GET", - cancellationToken: ctx.wex.cancellationToken, - }); + const res = await ctx.wex.ws.runLongpollQueueing( + url.hostname, + async (timeoutMs) => { + url.searchParams.set("long_poll_ms", `${timeoutMs}`); + + return await ctx.wex.http.fetch(url.href, { + method: "GET", + cancellationToken: ctx.wex.cancellationToken, + }); + }, + ); // If the bank claims that the withdrawal operation is already // pending, but we're still in DialogProposed, some other wallet |