박은주

Add Scheduler

Showing 1 changed file with 9 additions and 2 deletions
const http = require('http');
const express = require('express')
const express = require('express');
const fs = require('fs');
const path = require('path');
const schedule = require('node-schedule');
const spawn = require('child_process').spawn;
const { rawListeners } = require('process');
var port = 23023;
......@@ -15,6 +16,12 @@ app.engine('html', require('ejs').renderFile);
app.use(express.static(__dirname + '/static'));
function update() {
console.log('Updating . . .');
spawn('python3', ["run.py"])
}
setInterval(update, 1000 * 60 * 60 * 3)
var server = http.createServer(app).listen(port, function(){
console.log("Server Running . . .");
})
\ No newline at end of file
......