diff options
author | Sebastian <sebasjm@gmail.com> | 2022-04-28 15:55:20 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-04-28 15:55:20 -0300 |
commit | 508f5d2ea7a0c83eeb35bfae08a514c7e23fd884 (patch) | |
tree | 02b43d1769c93e35f601a0d97be69d4f8e304f77 /packages/taler-wallet-core/src | |
parent | b239ae1029eef5a68bf98d21e81acd317abb0673 (diff) | |
download | wallet-core-508f5d2ea7a0c83eeb35bfae08a514c7e23fd884.tar.xz |
simplify alarm and check webRequest without using 'in'
Diffstat (limited to 'packages/taler-wallet-core/src')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 579710d4e..96722aefb 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -327,27 +327,6 @@ export interface RetryLoopOpts { } /** - * This iteration hint will keep incrementing while the taskLoop iteration. - * If the hint does not match the current iteration it means that another - * promises is also working or has done some work before. - */ -let iterationHint = 0 -function thereIsAnotherPromiseWorking(iteration: number): boolean { - if (iterationHint > iteration) { - logger.trace(`some other promise is or has done some progress`); - iterationHint = iteration; - //we know that another promise did some work but don't know if still active - //so we take ownership and do work - } else if (iterationHint < iteration) { - //another promise take ownership that means that our time has come to an end - return true - } - // increment the hint to match the next loop - iterationHint++ - return false -} - -/** * Main retry loop of the wallet. * * Looks up pending operations from the wallet, runs them, repeat. @@ -357,10 +336,6 @@ async function runTaskLoop( opts: RetryLoopOpts = {}, ): Promise<void> { for (let iteration = 0; !ws.stopped; iteration++) { - if (thereIsAnotherPromiseWorking(iteration)) { - logger.trace(`another promise is working, we just need one`); - return; - } const pending = await getPendingOperations(ws); logger.trace(`pending operations: ${j2s(pending)}`); let numGivingLiveness = 0; |