Skip to content

Commit

Permalink
Show a way to run a single crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
Asing1001 committed Apr 16, 2022
1 parent b55a8e8 commit 6489560
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ For server developement, server run at http://localhost:3003:
3. Start scheduler for crawl yahoo/imdb/ptt
![system diagram](https://github.com/Asing1001/system-diagrams/blob/master/mvrater.jpg?raw=true)

## Crawler

- To manually run a single crawler you could reference firstTimeSetup.ts, and run `yarn setup`

## Reference

The project UI is using [Material-UI](https://github.com/callemall/material-ui)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"heroku-postbuild": "npm run build && npm run sitemap",
"tsc:w": "tsc -w",
"dev": "concurrently \"npm run tsc:w\" \"tsc && npm start\" \"npm run webpack\"",
"mergedata": "node dist/backgroundService/mergeDataJob.js"
"mergedata": "node dist/backgroundService/mergeDataJob.js",
"setup": "node dist/dbScript/firstTimeSetup"
},
"private": true,
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/dbScript/firstTimeSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ async function setup() {
await ensureCrawlerStatus();
await updateTheaterWithLocationList();
console.log('db setup done');
process.exit();
}

async function ensureCollectionAndIndex() {
Expand Down

0 comments on commit 6489560

Please sign in to comment.