code changes
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-05-26 19:01:34 +03:00
parent 89a55a1898
commit 73784275d6
2 changed files with 29 additions and 4 deletions
+8 -4
View File
@@ -12,7 +12,7 @@ const configPath = path.join(__dirname, "config.yml");
const config = yaml.load(fs.readFileSync(configPath, "utf8"));
const PORT = config.server?.port || 4000;
const HOSTS = config.targets?.hosts || ["http://127.0.0.1:7088"];
const HOSTS = config.targets?.hosts || ["http://127.0.0.1:7088", name: "my-server"];
const ENDPOINTS = config.targets?.endpoints || [];
const TIMEOUT = config.targets?.timeout || 120_000;
@@ -52,7 +52,7 @@ app.post("/api/parallel-fetch", async (req, res) => {
socket.emit("batch:start", { url, total: tasks.length });
const promises = tasks.map(({ host, endpoint }) => {
const fullUrl = host + endpoint;
const fullUrl = host.url + endpoint;
const start = Date.now();
return axios({
@@ -66,7 +66,9 @@ app.post("/api/parallel-fetch", async (req, res) => {
const elapsed = Date.now() - start;
console.log(`[OK] ${host} ${endpoint} (${elapsed}ms)`);
socket.emit("tool:response", {
host, endpoint,
host: host.url,
serverName: host.name,
endpoint,
ok: true,
status: response.status,
data: response.data,
@@ -77,7 +79,9 @@ app.post("/api/parallel-fetch", async (req, res) => {
const elapsed = Date.now() - start;
console.log(`[ERROR] ${host} ${endpoint} (${elapsed}ms) — ${err.message}`);
socket.emit("tool:error", {
host, endpoint,
host: host.url,
serverName: host.name,
endpoint,
ok: false,
error: err.message,
code: err.code || null,