fix(backups): не повторять импорт после потери ответа

This commit is contained in:
Denozordec committed 2026-10-01 16:22:06 +07:00
1 parent 99ff5aebaf
commit 39570656c9
10 files changed
+63 -8

No files matched your search

+2 -1
View File
@@ -784,7 +784,8 @@ export class MikrotikClient {
async importUploadedFile(fileName: string): Promise<unknown> {
try {
return await this.post("/import", { "file-name": fileName }, 120_000)
} catch {
} catch (error) {
if (!(error instanceof MikrotikError) || ![404, 405].includes(error.statusCode)) throw error
return await this.post("/execute", { script: `/import file-name="${fileName}"` }, 120_000)
}
}