mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +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)
|
||||
if (!t || +new Date() - t > 86400000) {
|
||||
if (!t || +new Date() - t > 3600 * 1000) {
|
||||
console.log('stale ' + String(t))
|
||||
data.set('t-' + name, +new Date())
|
||||
GITR.repo('samsonjs/' + name)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
var data = createObjectStore('proj')
|
||||
, t = data.get('t-proj')
|
||||
, names = ['followers', 'following', 'repos', 'watched']
|
||||
if (!t || +new Date() - t > 86400000) {
|
||||
if (!t || +new Date() - t > 3600 * 1000) {
|
||||
console.log('stale ' + String(t))
|
||||
data.set('t-proj', +new Date())
|
||||
names.forEach(function(name) {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
var data = createObjectStore('proj')
|
||||
, t = data.get('t-proj')
|
||||
, names = ['followers', 'following', 'repos', 'watched']
|
||||
if (!t || +new Date() - t > 86400000) {
|
||||
if (!t || +new Date() - t > 3600 * 1000) {
|
||||
console.log('stale ' + String(t))
|
||||
data.set('t-proj', +new Date())
|
||||
names.forEach(function(name) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue