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