diff --git a/api/server.js b/api/server.js index e1c662c..702f7b2 100644 --- a/api/server.js +++ b/api/server.js @@ -23,6 +23,7 @@ async function buildSpec () { async function checkLoaded () { const specStat = fs.statSync(SPEC_FILE) + console.log(new Date(specStat.mtime), mtime) if (new Date(specStat.mtime) > mtime) { console.log('Found new version, rebuilding ..') await buildSpec() @@ -47,11 +48,11 @@ const init = async () => { await server.start(); console.log('Server running on %s', server.info.uri); - setTimeout(async () => { + setInterval(async () => { await buildSpec() }, 1000 * 60 * 15) - setTimeout(async () => { + setInterval(async () => { await checkLoaded() }, 1000 * 60)