mirror of https://github.com/NobyDa/Script.git
Reduce cache time.
This commit is contained in:
parent
6137b5add4
commit
16a20f1b85
|
@ -3,7 +3,7 @@ TestFlight账户管理脚本
|
|||
|
||||
脚本作者: @NobyDa
|
||||
脚本兼容: Surge4、QuantumultX、Loon(2.1.20 413+)
|
||||
更新时间: 2024/04/07
|
||||
更新时间: 2024/04/13
|
||||
主要功能:
|
||||
1. 自动存储多个TestFlight账户,并自动合并APP列表,避免切换账户。
|
||||
|
||||
|
@ -198,7 +198,7 @@ function QueryRequest(o) {
|
|||
if ($.EnableCache && r.body && r.body.startsWith('{')) {
|
||||
$.log(`Account "${o}" URL "${option.url}" Write data to cache`);
|
||||
cache[option.url] = { response: r, lastUsed: Date.now() };
|
||||
Object.keys(cache).forEach((i) => (Date.now() - (cache[i].lastUsed || 0) > 864e5 * 7) && delete cache[i]);
|
||||
Object.keys(cache).forEach((i) => (Date.now() - (cache[i].lastUsed || 0) > 864e5 * 3) && delete cache[i]);
|
||||
$.write(JSON.stringify(cache), '#TESTFLIGHT-ACCOUNT-CACHE');
|
||||
}
|
||||
return { ...r, account: o }
|
||||
|
|
Loading…
Reference in New Issue