This commit is contained in:
Philip Ahlqvist 2025-04-20 20:52:57 +02:00
parent e8bb671803
commit 15ff3bd393

View file

@ -15,9 +15,7 @@ let lastGithubFeedUpdate;
updateGithubFeed(); updateGithubFeed();
// Update the feed every 5 minutes // Update the feed every 5 minutes
setInterval(async () => { setInterval(() => { updateGithubFeed(); }, 5 * 60 * 1000);
githubFeed = await updateGithubFeed();
}, 5 * 60 * 1000);
// P R O G R A M // P R O G R A M
@ -315,21 +313,18 @@ async function updateGithubFeed() {
let response; let response;
try { try {
lastGithubFeedUpdate = new Date();
response = await fetch(`https://api.github.com/orgs/lbryfoundation/events`, process.env.GITHUB_TOKEN && { response = await fetch(`https://api.github.com/orgs/lbryfoundation/events`, process.env.GITHUB_TOKEN && {
headers: { headers: {
'Authorization': `Bearer ${process.env.GITHUB_TOKEN}` 'Authorization': `Bearer ${process.env.GITHUB_TOKEN}`
} }
}); });
} catch (err) { } catch (err) {
console.log(err); console.log(err);
return; return;
} }
githubFeed = await response.json(); githubFeed = await response.json();
lastGithubFeedUpdate = new Date();
} }