mirror of
https://github.com/Retropex/mempool.git
synced 2025-05-13 02:30:41 +02:00
Fix axios unix sockets
This commit is contained in:
parent
c760de1517
commit
849eebe583
@ -111,7 +111,7 @@ class FailoverRouter {
|
|||||||
for (const host of this.hosts) {
|
for (const host of this.hosts) {
|
||||||
try {
|
try {
|
||||||
const result = await (host.socket
|
const result = await (host.socket
|
||||||
? this.pollConnection.get<number>('/blocks/tip/height', { socketPath: host.host, timeout: config.ESPLORA.FALLBACK_TIMEOUT })
|
? this.pollConnection.get<number>('http://api/blocks/tip/height', { socketPath: host.host, timeout: config.ESPLORA.FALLBACK_TIMEOUT })
|
||||||
: this.pollConnection.get<number>(host.host + '/blocks/tip/height', { timeout: config.ESPLORA.FALLBACK_TIMEOUT })
|
: this.pollConnection.get<number>(host.host + '/blocks/tip/height', { timeout: config.ESPLORA.FALLBACK_TIMEOUT })
|
||||||
);
|
);
|
||||||
if (result) {
|
if (result) {
|
||||||
@ -288,7 +288,7 @@ class FailoverRouter {
|
|||||||
let url;
|
let url;
|
||||||
if (host.socket) {
|
if (host.socket) {
|
||||||
axiosConfig = { socketPath: host.host, timeout: config.ESPLORA.REQUEST_TIMEOUT, responseType };
|
axiosConfig = { socketPath: host.host, timeout: config.ESPLORA.REQUEST_TIMEOUT, responseType };
|
||||||
url = path;
|
url = 'http://api' + path;
|
||||||
} else {
|
} else {
|
||||||
axiosConfig = { timeout: config.ESPLORA.REQUEST_TIMEOUT, responseType };
|
axiosConfig = { timeout: config.ESPLORA.REQUEST_TIMEOUT, responseType };
|
||||||
url = host.host + path;
|
url = host.host + path;
|
||||||
|
Loading…
Reference in New Issue
Block a user