优化数据库查询布局
This commit is contained in:
@@ -64,12 +64,12 @@ function createClient(baseUrl) {
|
||||
/**
|
||||
* Test Prometheus connection
|
||||
*/
|
||||
async function testConnection(url) {
|
||||
async function testConnection(url, customTimeout = null) {
|
||||
const normalized = normalizeUrl(url);
|
||||
try {
|
||||
// Using native fetch to avoid follow-redirects/axios "protocol mismatch" issues in some Node environments
|
||||
const controller = new AbortController();
|
||||
const timer = setTimeout(() => controller.abort(), QUERY_TIMEOUT);
|
||||
const timer = setTimeout(() => controller.abort(), customTimeout || QUERY_TIMEOUT);
|
||||
|
||||
// Node native fetch - handles http/https automatically
|
||||
const res = await fetch(`${normalized}/api/v1/status/buildinfo`, {
|
||||
|
||||
Reference in New Issue
Block a user