fix(backups): не повторять импорт после потери ответа
This commit is contained in:
1 parent
99ff5aebaf
commit
39570656c9
10 files changed
+63
-8
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user