From 47a7564cfcc31afb982a6f183d122cb367d5214f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Thu, 31 Aug 2023 02:25:28 +0900 Subject: [PATCH 1/3] Bump failover timeout to 5s --- backend/src/api/bitcoin/esplora-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/api/bitcoin/esplora-api.ts b/backend/src/api/bitcoin/esplora-api.ts index a44720d83..d6d4327cb 100644 --- a/backend/src/api/bitcoin/esplora-api.ts +++ b/backend/src/api/bitcoin/esplora-api.ts @@ -75,9 +75,9 @@ class FailoverRouter { const results = await Promise.allSettled(this.hosts.map(async (host) => { if (host.socket) { - return this.pollConnection.get('/blocks/tip/height', { socketPath: host.host, timeout: 2000 }); + return this.pollConnection.get('/blocks/tip/height', { socketPath: host.host, timeout: 5000 }); } else { - return this.pollConnection.get(host.host + '/blocks/tip/height', { timeout: 2000 }); + return this.pollConnection.get(host.host + '/blocks/tip/height', { timeout: 5000 }); } })); const maxHeight = results.reduce((max, result) => Math.max(max, result.status === 'fulfilled' ? result.value?.data || 0 : 0), 0); From ce3b599babea5e99868797db87501457e6b8b5aa Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 31 Aug 2023 02:36:22 +0900 Subject: [PATCH 2/3] ops: Add `/api/v1/services` route for new backend --- production/nginx/location-api-v1-services.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/production/nginx/location-api-v1-services.conf b/production/nginx/location-api-v1-services.conf index aae49727e..4759fe1ec 100644 --- a/production/nginx/location-api-v1-services.conf +++ b/production/nginx/location-api-v1-services.conf @@ -1,3 +1,15 @@ +location /api/v1/services { + proxy_pass $mempoolSpaceServices; + proxy_cache services; + proxy_cache_background_update on; + proxy_cache_use_stale updating; + proxy_cache_valid 200 1d; + expires 1d; + proxy_hide_header onion-location; + proxy_hide_header strict-transport-security; + proxy_hide_header content-security-policy; + proxy_hide_header x-frame-options; +} location /api/v1/contributors/images { proxy_pass $mempoolSpaceServices; proxy_cache services; From 827b0f6ad1c419e79d1a5cfa55b74b9c993a4748 Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 31 Aug 2023 16:52:16 +0900 Subject: [PATCH 3/3] ops: Make install script wait longer for mysql to start --- production/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/install b/production/install index 7ab1e657b..9761d2b33 100755 --- a/production/install +++ b/production/install @@ -1793,7 +1793,7 @@ case $OS in esac # wait for mysql to start -sleep 5 +sleep 10 mysql << _EOF_ create database mempool;