Showing
1 changed file
with
8 additions
and
0 deletions
... | @@ -16,6 +16,14 @@ async function checkData() { | ... | @@ -16,6 +16,14 @@ async function checkData() { |
16 | try { | 16 | try { |
17 | if (fakerData.version == version) { | 17 | if (fakerData.version == version) { |
18 | console.log("이미 데이터가 존재합니다."); | 18 | console.log("이미 데이터가 존재합니다."); |
19 | + | ||
20 | + var today = new Date(); | ||
21 | + var dateInfo = `${today.getFullYear()}/${today.getMonth() + 1}/${today.getDate()}`; | ||
22 | + if (fakerData.date != dateInfo) | ||
23 | + { | ||
24 | + console.log("오래된 데이터입니다. 데이터를 크롤링합니다."); | ||
25 | + await getData(); | ||
26 | + } | ||
19 | } | 27 | } |
20 | else if (fakerData.version == undefined) { | 28 | else if (fakerData.version == undefined) { |
21 | const dataBuffer = fs.readFileSync(dataFileName); | 29 | const dataBuffer = fs.readFileSync(dataFileName); | ... | ... |
-
Please register or login to post a comment