Include SocksProxyAgent inside while loop
To address error Socks5 proxy rejected connection - Failure
This commit is contained in:
parent
c610cacee4
commit
40bfc6bff3
@ -167,6 +167,8 @@ class Bisq {
|
|||||||
};
|
};
|
||||||
let retry = 0;
|
let retry = 0;
|
||||||
|
|
||||||
|
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
|
||||||
|
try {
|
||||||
if (config.SOCKS5PROXY.ENABLED) {
|
if (config.SOCKS5PROXY.ENABLED) {
|
||||||
const socksOptions: any = {
|
const socksOptions: any = {
|
||||||
agentOptions: {
|
agentOptions: {
|
||||||
@ -189,8 +191,6 @@ class Bisq {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
|
|
||||||
try {
|
|
||||||
const data: AxiosResponse = await axios.get(`${BISQ_URL}/trades/?market=bsq_btc`, axiosOptions);
|
const data: AxiosResponse = await axios.get(`${BISQ_URL}/trades/?market=bsq_btc`, axiosOptions);
|
||||||
if (data.statusText === 'error' || !data.data) {
|
if (data.statusText === 'error' || !data.data) {
|
||||||
throw new Error(`Could not fetch data from Bisq market, Error: ${data.status}`);
|
throw new Error(`Could not fetch data from Bisq market, Error: ${data.status}`);
|
||||||
|
@ -62,6 +62,8 @@ class FiatConversion {
|
|||||||
|
|
||||||
let retry = 0;
|
let retry = 0;
|
||||||
|
|
||||||
|
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
|
||||||
|
try {
|
||||||
if (config.SOCKS5PROXY.ENABLED) {
|
if (config.SOCKS5PROXY.ENABLED) {
|
||||||
let socksOptions: any = {
|
let socksOptions: any = {
|
||||||
agentOptions: {
|
agentOptions: {
|
||||||
@ -84,8 +86,6 @@ class FiatConversion {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
|
|
||||||
try {
|
|
||||||
logger.debug('Querying currency rates service...');
|
logger.debug('Querying currency rates service...');
|
||||||
|
|
||||||
const response: AxiosResponse = await axios.get(`${fiatConversionUrl}`, axiosOptions);
|
const response: AxiosResponse = await axios.get(`${fiatConversionUrl}`, axiosOptions);
|
||||||
|
@ -129,6 +129,8 @@ class PoolsUpdater {
|
|||||||
};
|
};
|
||||||
let retry = 0;
|
let retry = 0;
|
||||||
|
|
||||||
|
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
|
||||||
|
try {
|
||||||
if (config.SOCKS5PROXY.ENABLED) {
|
if (config.SOCKS5PROXY.ENABLED) {
|
||||||
const socksOptions: any = {
|
const socksOptions: any = {
|
||||||
agentOptions: {
|
agentOptions: {
|
||||||
@ -146,8 +148,6 @@ class PoolsUpdater {
|
|||||||
axiosOptions.httpsAgent = new SocksProxyAgent(socksOptions);
|
axiosOptions.httpsAgent = new SocksProxyAgent(socksOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(retry < config.MEMPOOL.EXTERNAL_MAX_RETRY) {
|
|
||||||
try {
|
|
||||||
const data: AxiosResponse = await axios.get(path, axiosOptions);
|
const data: AxiosResponse = await axios.get(path, axiosOptions);
|
||||||
if (data.statusText === 'error' || !data.data) {
|
if (data.statusText === 'error' || !data.data) {
|
||||||
throw new Error(`Could not fetch data from Github, Error: ${data.status}`);
|
throw new Error(`Could not fetch data from Github, Error: ${data.status}`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user