fix(api): прекращать диагностику при отмене HTTP
This commit is contained in:
1 parent
9d2101d700
commit
440e10c646
6 files changed
+89
-11
No files matched your search
@@ -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>>> {
|
||||
|
||||
Reference in new issue
Block a user