Update server
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
tree 2022-10-21 14:41:19 +02:00
parent 2ad67fc507
commit 22e0795bf0
1 changed files with 3 additions and 2 deletions

View File

@ -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)