diff options
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index d0095626a..42aa8cdfc 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -387,13 +387,6 @@ export interface RetryLoopOpts { stopWhenDone?: boolean; } -export interface TaskLoopResult { - /** - * Was the maximum number of retries exceeded in a task? - */ - retriesExceeded: boolean; -} - /** * Main retry loop of the wallet. * @@ -402,7 +395,7 @@ export interface TaskLoopResult { async function runTaskLoop( ws: InternalWalletState, opts: RetryLoopOpts = {}, -): Promise<TaskLoopResult> { +): Promise<void> { logger.trace(`running task loop opts=${j2s(opts)}`); if (ws.isTaskLoopRunning) { logger.warn( @@ -411,7 +404,6 @@ async function runTaskLoop( } const throttler = new TaskThrottler(); ws.isTaskLoopRunning = true; - let retriesExceeded = false; for (let iteration = 0; !ws.stopped; iteration++) { const pending = await getPendingOperations(ws); logger.trace(`pending operations: ${j2s(pending)}`); @@ -449,16 +441,12 @@ async function runTaskLoop( if (opts.stopWhenDone && numGivingLiveness === 0 && iteration !== 0) { logger.warn(`stopping, as no pending operations have lifeness`); ws.isTaskLoopRunning = false; - return { - retriesExceeded, - }; + return; } if (ws.stopped) { ws.isTaskLoopRunning = false; - return { - retriesExceeded, - }; + return; } // Make sure that we run tasks that don't give lifeness at least @@ -502,18 +490,14 @@ async function runTaskLoop( } if (ws.stopped) { ws.isTaskLoopRunning = false; - return { - retriesExceeded, - }; + return; } } } } logger.trace("exiting wallet task loop"); ws.isTaskLoopRunning = false; - return { - retriesExceeded, - }; + return; } /** @@ -1655,7 +1639,7 @@ export class Wallet { return runPending(this.ws); } - async runTaskLoop(opts?: RetryLoopOpts): Promise<TaskLoopResult> { + async runTaskLoop(opts?: RetryLoopOpts): Promise<void> { await this.ws.ensureWalletDbOpen(); return runTaskLoop(this.ws, opts); } |