Allowing cached results for static puzzle content

This commit is contained in:
John Donaldson 2019-10-28 18:11:25 +00:00
parent 588070748a
commit 3fc84e532e
1 changed files with 5 additions and 3 deletions

View File

@ -133,7 +133,9 @@ function drawCacheButton(teamId) {
} else {
cacher.style.display = "none";
}
});
}).catch( ex => {
cacher.style.display = "none";
})
}
setInterval ( updateCacheButton , 30000);
@ -156,7 +158,7 @@ async function fetchAll(teamId) {
if (resource == "puzzles.json") {
continue;
}
fetch(resource, {headers: headers})
fetch(resource)
.then( e => {
console.log("Fetched " + resource);
})
@ -179,7 +181,7 @@ async function fetchAll(teamId) {
let puzzles = categories[cat_name];
for (let puzzle of puzzles) {
let url = "puzzle.html?cat=" + cat_name + "&points=" + puzzle[0] + "&pid=" + puzzle[1];
requests.push( fetch(url, {headers: headers})
requests.push( fetch(url)
.then( e => {
console.log("Fetched " + url);
}));