Skip to content

Commit

Permalink
change: cache update method
Browse files Browse the repository at this point in the history
  • Loading branch information
Nem-Tudo committed Sep 19, 2024
1 parent dfc5cf2 commit 0d8f6e1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ async function updateCacheSettings() {
cache.settings.trendsMessages = settings.trendsMessages;
}

updateCacheTrending();
async function updateCacheTrending() {
cache.trending.pt.data = await getTrending(15, 6, ["pt"]);
cache.trending.pt.head.time = Date.now();
Expand Down Expand Up @@ -570,14 +569,11 @@ async function updateCacheTrending() {
`=============================== Cache atualizado (${Date.now()}) ===============================`,
);
cache._firstUpdated = true;

setTimeout(() => {
updateCacheTrending();
}, 29 * 1000);
}

setInterval(() => {
updateCacheSettings();
setInterval(async () => {
await updateCacheSettings();
updateCacheTrending();
}, 29 * 1000);

setTimeout(
Expand Down

0 comments on commit 0d8f6e1

Please sign in to comment.