Toggle navigation
Toggle navigation
This project
Loading...
Sign in
전세계
/
FakerQuiz
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
전세계
2020-06-18 12:15:32 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
54005315afb58d5765a1061a2b55ae5963c20dbe
54005315
1 parent
91ece03f
기능: 데이터의 날짜가 다를 경우 다시 크롤링
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
app.js
app.js
View file @
5400531
...
...
@@ -16,6 +16,14 @@ async function checkData() {
try
{
if
(
fakerData
.
version
==
version
)
{
console
.
log
(
"이미 데이터가 존재합니다."
);
var
today
=
new
Date
();
var
dateInfo
=
`
${
today
.
getFullYear
()}
/
${
today
.
getMonth
()
+
1
}
/
${
today
.
getDate
()}
`
;
if
(
fakerData
.
date
!=
dateInfo
)
{
console
.
log
(
"오래된 데이터입니다. 데이터를 크롤링합니다."
);
await
getData
();
}
}
else
if
(
fakerData
.
version
==
undefined
)
{
const
dataBuffer
=
fs
.
readFileSync
(
dataFileName
);
...
...
Please
register
or
login
to post a comment