MCPcopy
hub / github.com/chavyleung/scripts / reloadAppSubCaches

Function reloadAppSubCaches

chavy.box.js:1035–1052  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1033}
1034
1035async 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
1054function upgradeUserData() {
1055 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…