Beginning of a way to disable client cache

This is so that share links don't clobber local storage, some day.
main
Ryan Rix 2017-07-03 22:34:52 -05:00
parent c63ddbda5c
commit 599f055910
2 changed files with 16 additions and 10 deletions

View File

@ -1,17 +1,23 @@
// custom javascript
var cacheEnabled = false;
var updateCache = function() {
window.localStorage.setItem('cache', cache);
if (cacheEnabled) {
window.localStorage.setItem('cache', cache);
}
}
var primeCache = function() {
var string = window.localStorage.getItem('cache') || "";
var strCache = string.split(",");
var cache = [];
strCache.map(function(item) {
cache[cache.length] = (item == 'true');
setRowValue(cache.length, cache[cache.length-1]);
});
if (cacheEnabled) {
var string = window.localStorage.getItem('cache') || "";
var strCache = string.split(",");
cache = [];
strCache.map(function(item) {
cache[cache.length] = (item == 'true');
setRowValue(cache.length, cache[cache.length-1]);
});
} else {
cache = [];
}
}
primeCache();

View File

@ -52,7 +52,7 @@ def load_run_cache():
def fetch_runs():
try:
logger.warn("Re-fetching cache")
r = requests.get(TRACKER_URL, timeout=3)
r = requests.get(TRACKER_URL, timeout=5)
if r.status_code != 200:
raise GDQException("GDQ not returning 200")
output = r.json()