김대선

데이터 저장이 안되는 오류 수정

...@@ -15,7 +15,7 @@ const data = require('./functions/dataFunctions') ...@@ -15,7 +15,7 @@ const data = require('./functions/dataFunctions')
15 const find = require('./functions/findFunction') 15 const find = require('./functions/findFunction')
16 16
17 // 0초 0분 0시 아무날 아무달 아무년 17 // 0초 0분 0시 아무날 아무달 아무년
18 -const saveData = schedule.scheduleJob('55 49 19 * * *', data.save) 18 +const saveData = schedule.scheduleJob('55 29 20 * * *', data.save)
19 19
20 var app = express(); 20 var app = express();
21 app.use(bodyParser.json()); 21 app.use(bodyParser.json());
......
...@@ -49,7 +49,6 @@ const save = async()=> { ...@@ -49,7 +49,6 @@ const save = async()=> {
49 temp = "companyName : " + i.companyName 49 temp = "companyName : " + i.companyName
50 string = string + temp + "\n" 50 string = string + temp + "\n"
51 } 51 }
52 -
53 data = await functions.getNaverFunction() 52 data = await functions.getNaverFunction()
54 temp = "" 53 temp = ""
55 for(let i of data){ 54 for(let i of data){
...@@ -62,7 +61,7 @@ const save = async()=> { ...@@ -62,7 +61,7 @@ const save = async()=> {
62 temp = "companyName : " + i.companyName 61 temp = "companyName : " + i.companyName
63 string = string + temp + "\n" 62 string = string + temp + "\n"
64 } 63 }
65 - 64 +
66 data = await functions.getProgrammersFunction() 65 data = await functions.getProgrammersFunction()
67 temp = "" 66 temp = ""
68 for(let i of data){ 67 for(let i of data){
...@@ -75,6 +74,7 @@ const save = async()=> { ...@@ -75,6 +74,7 @@ const save = async()=> {
75 temp = "companyName : " + i.companyName 74 temp = "companyName : " + i.companyName
76 string = string + temp + "\n" 75 string = string + temp + "\n"
77 } 76 }
77 +
78 const today = new Date() 78 const today = new Date()
79 fs.writeFile(`./datas/${today.getFullYear()}.${today.getMonth()}.${today.getDate()}`, string, 'utf-8', (err)=>{ 79 fs.writeFile(`./datas/${today.getFullYear()}.${today.getMonth()}.${today.getDate()}`, string, 'utf-8', (err)=>{
80 if(err){ 80 if(err){
......