From 50f5c0bd60215d9315d845b23de338c33805fb37 Mon Sep 17 00:00:00 2001 From: develop202 Date: Fri, 16 Jan 2026 15:28:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=9C=B0=E5=9D=80=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=A4=B1=E8=B4=A5=E5=90=8E=E9=87=8D=E8=AF=95=E4=B8=89?= =?UTF-8?q?=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fetchURLByzbpro.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/fetchURLByzbpro.js b/fetchURLByzbpro.js index 5317594..3f94f4e 100644 --- a/fetchURLByzbpro.js +++ b/fetchURLByzbpro.js @@ -10,7 +10,15 @@ printMagenta("开始更新...") printMagenta("开始更新接口文件...") -const updateResult = await updateChannels() +let updateResult = 2 +for (let i = 0; i < 3; i++) { + try { + updateResult = await updateChannels() + } catch (error) { + printRed("接口更新出现问题,正在重试...") + } +} + switch (updateResult) { case 1: printGreen(`接口数据已是最新,无需更新`) @@ -18,8 +26,7 @@ switch (updateResult) { break case 2: printRed(`接口请求失败`) - // process.exit(1) - break + process.exit(1) default: printGreen("接口文件更新完成!") break;