summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-13 11:00:55 +0100
committerFlorian Dold <florian@dold.me>2024-02-13 11:00:55 +0100
commit1d38c8e57dff7dd60e600d71e48664d72d544fdd (patch)
tree25d4e00906c99d30eecf608add2525ee7e19b8bc /packages/taler-wallet-core/src/wallet.ts
parent8677830b02d8d098cb94752d894903cc476b6703 (diff)
downloadwallet-core-1d38c8e57dff7dd60e600d71e48664d72d544fdd.tar.gz
wallet-core-1d38c8e57dff7dd60e600d71e48664d72d544fdd.tar.bz2
wallet-core-1d38c8e57dff7dd60e600d71e48664d72d544fdd.zip
wallet-core: get rid of TaskLoopResult
Also not used anymore.
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts28
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);
}