From 8677830b02d8d098cb94752d894903cc476b6703 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 13 Feb 2024 10:58:11 +0100 Subject: wallet-core: get rid of max retries in task loop It's not used anywhere. --- packages/taler-harness/src/harness/harness.ts | 8 +++----- packages/taler-wallet-cli/src/index.ts | 10 +--------- packages/taler-wallet-core/src/wallet.ts | 19 ------------------- 3 files changed, 4 insertions(+), 33 deletions(-) (limited to 'packages') diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts index b9164a968..48f8450fd 100644 --- a/packages/taler-harness/src/harness/harness.ts +++ b/packages/taler-harness/src/harness/harness.ts @@ -26,9 +26,9 @@ */ import { AccountAddDetails, + AccountRestriction, AmountJson, Amounts, - TalerCorebankApiClient, Configuration, CoreApiResponse, Duration, @@ -36,6 +36,7 @@ import { Logger, MerchantInstanceConfig, PartialMerchantInstanceConfig, + TalerCorebankApiClient, TalerError, WalletNotification, createEddsaKeyPair, @@ -45,7 +46,6 @@ import { j2s, parsePaytoUri, stringToBytes, - AccountRestriction, } from "@gnu-taler/taler-util"; import { HttpRequestLibrary, @@ -73,7 +73,6 @@ import * as http from "http"; import * as net from "node:net"; import * as path from "path"; import * as readline from "readline"; -import { URL } from "url"; import { CoinConfig } from "./denomStructures.js"; const logger = new Logger("harness.ts"); @@ -2131,7 +2130,7 @@ export class WalletCli { return this._client; } - async runUntilDone(args: { maxRetries?: number } = {}): Promise { + async runUntilDone(args: {} = {}): Promise { await runCommand( this.globalTestState, `wallet-${this.name}`, @@ -2144,7 +2143,6 @@ export class WalletCli { "--wallet-db", this.dbfile, "run-until-done", - ...(args.maxRetries ? ["--max-retries", `${args.maxRetries}`] : []), ], ); } diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index 900649c61..91dcd2702 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -34,7 +34,6 @@ import { parsePaytoUri, parseTalerUri, PreparePayResultType, - RecoveryMergeStrategy, sampleWalletCoreTransactions, setDangerousTimetravel, setGlobalLogLevelFromString, @@ -56,7 +55,6 @@ import { createPlatformHttpLib } from "@gnu-taler/taler-util/http"; import { JsonMessage, runRpcServer } from "@gnu-taler/taler-util/twrpc"; import { AccessStats, - createNativeWalletHost, createNativeWalletHost2, Wallet, WalletApiOperation, @@ -554,19 +552,13 @@ walletCli .subcommand("finishPendingOpt", "run-until-done", { help: "Run until no more work is left.", }) - .maybeOption("maxRetries", ["--max-retries"], clk.INT) - .flag("failOnMaxRetries", ["--fail-on-max-retries"]) .action(async (args) => { await withLocalWallet(args, async (wallet) => { logger.info("running until pending operations are finished"); - const resp = await wallet.ws.runTaskLoop({ - maxRetries: args.finishPendingOpt.maxRetries, + await wallet.ws.runTaskLoop({ stopWhenDone: true, }); wallet.ws.stop(); - if (resp.retriesExceeded && args.finishPendingOpt.failOnMaxRetries) { - processExit(EXIT_RETRIES_EXCEEDED); - } }); }); diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 0b7229cf3..d0095626a 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -63,7 +63,6 @@ import { codecForAcceptExchangeTosRequest, codecForAcceptManualWithdrawalRequet, codecForAcceptPeerPullPaymentRequest, - codecForAcceptTipRequest, codecForAddExchangeRequest, codecForAddGlobalCurrencyAuditorRequest, codecForAddGlobalCurrencyExchangeRequest, @@ -104,7 +103,6 @@ import { codecForPreparePeerPullPaymentRequest, codecForPreparePeerPushCreditRequest, codecForPrepareRefundRequest, - codecForPrepareRewardRequest, codecForPrepareWithdrawExchangeRequest, codecForRecoverStoredBackupRequest, codecForRemoveGlobalCurrencyAuditorRequest, @@ -249,9 +247,7 @@ import { processRefreshGroup, } from "./operations/refresh.js"; import { - acceptTipBackwardCompat, computeRewardTransactionStatus, - prepareReward, processTip, } from "./operations/reward.js"; import { @@ -382,12 +378,6 @@ export async function runPending(ws: InternalWalletState): Promise { } export interface RetryLoopOpts { - /** - * Stop when the number of retries is exceeded for any pending - * operation. - */ - maxRetries?: number; - /** * Stop the retry loop when all lifeness-giving pending operations * are done. @@ -431,15 +421,6 @@ async function runTaskLoop( let minDue: AbsoluteTime = AbsoluteTime.never(); for (const p of pending.pendingOperations) { - const maxRetries = opts.maxRetries; - - if (maxRetries && p.retryInfo && p.retryInfo.retryCounter > maxRetries) { - retriesExceeded = true; - logger.warn( - `skipping, as ${maxRetries} retries are exceeded in an operation of type ${p.type}`, - ); - continue; - } if (p.givesLifeness) { numGivingLiveness++; } -- cgit v1.2.3