Commit c4a7c054 authored by Sebastien Chopin's avatar Sebastien Chopin

Fix cachedIds

parent 4689d337
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import { createAPI } from 'create-api' import { createAPI } from 'create-api'
const logRequests = !!process.env.DEBUG_API const logRequests = !!process.env.DEBUG_API
let api = null let api = {}
let _api = createAPI({ let _api = createAPI({
version: '/v0', version: '/v0',
...@@ -21,6 +21,7 @@ let _api = createAPI({ ...@@ -21,6 +21,7 @@ let _api = createAPI({
function warmCache() { function warmCache() {
if (!api.cachedIds) return
fetchItems((api.cachedIds.top || []).slice(0, 30)) fetchItems((api.cachedIds.top || []).slice(0, 30))
setTimeout(warmCache, 1000 * 60 * 15) setTimeout(warmCache, 1000 * 60 * 15)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment