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

Function reloadAppSubCaches

box/chavy.boxjs.js:1092–1109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1090}
1091
1092async 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
1111function upgradeUserData() {
1112 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