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