MCPcopy Create free account
hub / github.com/chavyleung/scripts / reloadAppSubCaches

Function reloadAppSubCaches

chavy.box.js:1094–1111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1092}
1093
1094async 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
1113function upgradeUserData() {
1114 const usercfgs = getUserCfgs()

Callers 1

apiReloadAppSubFunction · 0.70

Calls 5

getUserCfgsFunction · 0.70
reloadAppSubCacheFunction · 0.70
limitConcurrencyFunction · 0.70
msgMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected