mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
[monitoring] fix liquid health check hostnames
This commit is contained in:
parent
eb029aef95
commit
267b4f00f7
1 changed files with 19 additions and 4 deletions
|
|
@ -253,7 +253,12 @@ class FailoverRouter {
|
|||
private async $updateFrontendGitHash(host: FailoverHost): Promise<void> {
|
||||
try {
|
||||
const url = `${host.publicDomain}/resources/config.js`;
|
||||
const response = await this.pollConnection.get<string>(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT });
|
||||
const response = await this.pollConnection.get<string>(
|
||||
url, {
|
||||
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
|
||||
headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined
|
||||
}
|
||||
);
|
||||
const match = response.data.match(/GIT_COMMIT_HASH\s*=\s*['"](.*?)['"]/);
|
||||
if (match && match[1]?.length) {
|
||||
host.hashes.frontend = match[1];
|
||||
|
|
@ -276,7 +281,7 @@ class FailoverRouter {
|
|||
path: '/en-US/resources/config.js',
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Host': 'mempool.space'
|
||||
'Host': Common.isLiquid() ? 'liquid.network' : 'mempool.space'
|
||||
},
|
||||
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
|
||||
}, (res) => {
|
||||
|
|
@ -307,7 +312,12 @@ class FailoverRouter {
|
|||
private async $updateBackendVersions(host: FailoverHost): Promise<void> {
|
||||
try {
|
||||
const url = `${host.publicDomain}/api/v1/backend-info`;
|
||||
const response = await this.pollConnection.get<any>(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT });
|
||||
const response = await this.pollConnection.get<any>(
|
||||
url, {
|
||||
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
|
||||
headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined
|
||||
}
|
||||
);
|
||||
if (response.data?.gitCommit) {
|
||||
host.hashes.backend = response.data.gitCommit;
|
||||
}
|
||||
|
|
@ -322,7 +332,12 @@ class FailoverRouter {
|
|||
private async $updateSSRGitHash(host: FailoverHost): Promise<void> {
|
||||
try {
|
||||
const url = `${host.publicDomain}/ssr/api/status`;
|
||||
const response = await this.pollConnection.get<any>(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT });
|
||||
const response = await this.pollConnection.get<any>(
|
||||
url, {
|
||||
timeout: config.ESPLORA.FALLBACK_TIMEOUT,
|
||||
headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined
|
||||
}
|
||||
);
|
||||
if (response.data?.gitHash) {
|
||||
host.hashes.ssr = response.data.gitHash;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue