()
| 1090 | } |
| 1091 | |
| 1092 | async function reloadAppSubCaches() { |
| 1093 | $.msg($.name, '更新订阅: 开始!'); |
| 1094 | const reloadActs = []; |
| 1095 | const usercfgs = getUserCfgs(); |
| 1096 | |
| 1097 | // 收集所有任务(函数形式) |
| 1098 | usercfgs.appsubs.forEach((sub) => { |
| 1099 | reloadActs.push(() => reloadAppSubCache(sub.url)); // 存储函数而不是立即执行的 Promise |
| 1100 | }); |
| 1101 | |
| 1102 | // 使用并发限制执行任务 |
| 1103 | await limitConcurrency(reloadActs, 20); // 限制并发数为 20 |
| 1104 | |
| 1105 | $.log(`全部订阅, 完成!`); |
| 1106 | const endTime = new Date().getTime(); |
| 1107 | const costTime = (endTime - $.startTime) / 1000; |
| 1108 | $.msg($.name, `更新订阅: 完成! 🕛 ${costTime} 秒`); |
| 1109 | } |
| 1110 | |
| 1111 | function upgradeUserData() { |
| 1112 | const usercfgs = getUserCfgs() |
no test coverage detected