Skip to content

Commit

Permalink
Reduce cache time.
Browse files Browse the repository at this point in the history
  • Loading branch information
NobyDa committed Apr 13, 2024
1 parent 6137b5a commit 16a20f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TestFlight/TestFlightAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TestFlight账户管理脚本
脚本作者: @NobyDa
脚本兼容: Surge4、QuantumultX、Loon(2.1.20 413+)
更新时间: 2024/04/07
更新时间: 2024/04/13
主要功能:
1. 自动存储多个TestFlight账户,并自动合并APP列表,避免切换账户。
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 16a20f1

Please sign in to comment.