mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
cache github data for an hour
This commit is contained in:
parent
d156e343bc
commit
6e5d04a501
3 changed files with 3 additions and 3 deletions
|
|
@ -74,7 +74,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var t = data.get('t-' + name)
|
var t = data.get('t-' + name)
|
||||||
if (!t || +new Date() - t > 86400000) {
|
if (!t || +new Date() - t > 3600 * 1000) {
|
||||||
console.log('stale ' + String(t))
|
console.log('stale ' + String(t))
|
||||||
data.set('t-' + name, +new Date())
|
data.set('t-' + name, +new Date())
|
||||||
GITR.repo('samsonjs/' + name)
|
GITR.repo('samsonjs/' + name)
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
var data = createObjectStore('proj')
|
var data = createObjectStore('proj')
|
||||||
, t = data.get('t-proj')
|
, t = data.get('t-proj')
|
||||||
, names = ['followers', 'following', 'repos', 'watched']
|
, names = ['followers', 'following', 'repos', 'watched']
|
||||||
if (!t || +new Date() - t > 86400000) {
|
if (!t || +new Date() - t > 3600 * 1000) {
|
||||||
console.log('stale ' + String(t))
|
console.log('stale ' + String(t))
|
||||||
data.set('t-proj', +new Date())
|
data.set('t-proj', +new Date())
|
||||||
names.forEach(function(name) {
|
names.forEach(function(name) {
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
var data = createObjectStore('proj')
|
var data = createObjectStore('proj')
|
||||||
, t = data.get('t-proj')
|
, t = data.get('t-proj')
|
||||||
, names = ['followers', 'following', 'repos', 'watched']
|
, names = ['followers', 'following', 'repos', 'watched']
|
||||||
if (!t || +new Date() - t > 86400000) {
|
if (!t || +new Date() - t > 3600 * 1000) {
|
||||||
console.log('stale ' + String(t))
|
console.log('stale ' + String(t))
|
||||||
data.set('t-proj', +new Date())
|
data.set('t-proj', +new Date())
|
||||||
names.forEach(function(name) {
|
names.forEach(function(name) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue