aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-03-24 23:54:32 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-03-24 23:54:32 +0530
commitc2050b3963262ffe1c358f54b500910e766d5a81 (patch)
treeb74d011ab15c36e4c8e258cfb5c4c27ee9bbca3d /src
parent1bac5329b510e74d644d0edbf6118b527b10c8ad (diff)
add --no-throttle
Diffstat (limited to 'src')
-rw-r--r--src/headless/taler-wallet-cli.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts
index 416458487..fafa94874 100644
--- a/src/headless/taler-wallet-cli.ts
+++ b/src/headless/taler-wallet-cli.ts
@@ -33,6 +33,7 @@ import util = require("util");
import { Configuration } from "../util/talerconfig";
import { setDangerousTimetravel } from "../util/time";
import { makeCodecForList, codecForString } from "../util/codec";
+import { NodeHttpLib } from "./NodeHttpLib";
// Backwards compatibility with nodejs<0.11, where TextEncoder and TextDecoder
// are not globals yet.
@@ -133,6 +134,10 @@ const walletCli = clk
help:
"Inhibit running certain operations, useful for debugging and testing.",
})
+ .flag("noThrottle", ["--no-throttle"], {
+ help:
+ "Don't do any request throttling.",
+ })
.flag("version", ["-v", "--version"], {
onPresentHandler: printVersion,
})
@@ -147,8 +152,13 @@ async function withWallet<T>(
f: (w: Wallet) => Promise<T>,
): Promise<T> {
const dbPath = walletCliArgs.wallet.walletDbFile ?? defaultWalletDbPath;
+ const myHttpLib = new NodeHttpLib();
+ if (walletCliArgs.wallet.noThrottle) {
+ myHttpLib.setThrottling(false);
+ }
const wallet = await getDefaultNodeWallet({
persistentStoragePath: dbPath,
+ httpLib: myHttpLib,
});
applyVerbose(walletCliArgs.wallet.verbose);
try {