fix(api): прекращать диагностику при отмене HTTP

This commit is contained in:
Denozordec committed 2026-10-01 09:00:19 +07:00
1 parent 9d2101d700
commit 440e10c646
6 files changed
+89 -11

No files matched your search

+2 -2
View File
@@ -704,7 +704,7 @@ export class MikrotikClient {
protocol?: "tcp" | "udp"
direction?: "transmit" | "receive" | "both"
durationSec?: number
}): Promise<Array<Record<string, string>>> {
}, signal?: AbortSignal): Promise<Array<Record<string, string>>> {
const body: Record<string, string> = {
address: params.address,
user: params.user,
@@ -713,7 +713,7 @@ export class MikrotikClient {
direction: params.direction ?? "both",
duration: `${Math.max(3, params.durationSec ?? 10)}s`,
}
return this.post<Array<Record<string, string>>>("/tool/bandwidth-test", body, 30_000)
return this.post<Array<Record<string, string>>>("/tool/bandwidth-test", body, 30_000, signal)
}
async getCertificates(): Promise<Array<Record<string, string | undefined>>> {