()
| 1033 | } |
| 1034 | |
| 1035 | async function reloadAppSubCaches() { |
| 1036 | $.msg($.name, '更新订阅: 开始!') |
| 1037 | const reloadActs = [] |
| 1038 | const usercfgs = getUserCfgs() |
| 1039 | |
| 1040 | // 收集所有任务(函数形式) |
| 1041 | usercfgs.appsubs.forEach((sub) => { |
| 1042 | reloadActs.push(() => reloadAppSubCache(sub.url)) // 存储函数而不是立即执行的 Promise |
| 1043 | }) |
| 1044 | |
| 1045 | // 使用并发限制执行任务 |
| 1046 | await limitConcurrency(reloadActs, 20) // 限制并发数为 20 |
| 1047 | |
| 1048 | $.log(`全部订阅, 完成!`) |
| 1049 | const endTime = new Date().getTime() |
| 1050 | const costTime = (endTime - $.startTime) / 1000 |
| 1051 | $.msg($.name, `更新订阅: 完成! 🕛 ${costTime} 秒`) |
| 1052 | } |
| 1053 | |
| 1054 | function upgradeUserData() { |
| 1055 | const usercfgs = getUserCfgs() |
no test coverage detected
searching dependent graphs…