feat(NetworkMapScheduler): improve logging for speed test results by including server labels
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m39s

This commit is contained in:
2026-02-18 13:29:26 +07:00
parent 89d71ff060
commit 283ab53b80
+6 -3
View File
@@ -254,6 +254,9 @@ async function runJob(opts) {
const withSpeed = connections.filter((c) => c.speedTestServerId && c.interfaceName);
const speedTasks = withSpeed.map((c) => async () => {
const key = speedKey(c.fromKey, c.toKey);
const server = servers.find((s) => (s.id || s.dns || s.ip) === c.speedTestServerId);
const serverLabel = server ? (server.dns || server.ip || server.id) : c.speedTestServerId;
const speedLabel = `${serverLabel} / ${c.interfaceName}`;
try {
const res = await fetch(`${baseUrl}/api/mikrotik/speed-test`, {
method: 'POST',
@@ -279,16 +282,16 @@ async function runJob(opts) {
};
const down = data.tcpDownloadBps != null ? (data.tcpDownloadBps / 1e6).toFixed(1) : '—';
const up = data.tcpUploadBps != null ? (data.tcpUploadBps / 1e6).toFixed(1) : '—';
log(`Скорость ${c.interfaceName}: ↓${down}${up} Mbps`);
log(`Скорость ${speedLabel}: ↓${down}${up} Mbps`);
return speedMap[key];
}
speedMap[key] = null;
const speedErr = !res.ok ? (data?.message || `HTTP ${res.status}`) : 'нет данных';
log(`Скорость ${c.interfaceName}: ${speedErr}`);
log(`Скорость ${speedLabel}: ${speedErr}`);
return null;
} catch (e) {
speedMap[key] = null;
log(`Скорость ${c.interfaceName}: ошибка ${e?.message || e}`);
log(`Скорость ${speedLabel}: ошибка ${e?.message || e}`);
return null;
}
});