Skip to content

Commit

Permalink
Gracefully shutdown server (#419)
Browse files Browse the repository at this point in the history
* Gracefully shutdown server

* Forbid lint warnings
  • Loading branch information
prathamesh0 authored Nov 28, 2022
1 parent 25e41f5 commit 302be34
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ This project uses [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspac

This repo uses packages from [@cerc-io/watcher-ts](https://github.com/cerc-io/watcher-ts).

For development with changes in watcher-ts, yarn link the packages:
For development with changes in `watcher-ts`, yarn link the packages:

- In `@cerc-io/watcher-ts` repo, build and link the packages to use from uniswap-watcher-ts
- In `@cerc-io/watcher-ts` repo, build and link the packages to use in `uniswap-watcher-ts`:

```bash
# Build packages
Expand All @@ -52,7 +52,7 @@ For development with changes in watcher-ts, yarn link the packages:
yarn link "typeorm"
```

- Build all packages in uniswap-watcher-ts:
- Build all packages in `uniswap-watcher-ts`:

```bash
yarn build
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lerna": "^4.0.0"
},
"scripts": {
"lint": "lerna run lint --stream",
"lint": "lerna run lint --stream -- --max-warnings=0",
"test": "lerna run test --stream --no-bail",
"build": "lerna run build --stream",
"build:watch": "lerna run build --stream --parallel -- -w",
Expand Down
4 changes: 2 additions & 2 deletions packages/erc20-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"scripts": {
"lint": "eslint .",
"build": "tsc",
"server": "DEBUG=vulcanize:* node --enable-source-maps dist/server.js",
"server:dev": "DEBUG=vulcanize:* nodemon --watch src src/server.ts",
"server": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/server.js",
"server:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/server.ts",
"job-runner": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/job-runner.js",
"job-runner:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/job-runner.ts",
"watch:contract": "node --enable-source-maps dist/cli/watch-contract.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/uni-info-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"test:gpev": "mocha src/get-prev-entity.test.ts",
"test:init": "ts-node test/init.ts",
"build": "tsc",
"server": "DEBUG=vulcanize:* node --enable-source-maps dist/server.js",
"server:prof": "DEBUG=vulcanize:* node --require pprof --enable-source-maps dist/server.js",
"server:dev": "DEBUG=vulcanize:* nodemon --watch src src/server.ts",
"server": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/server.js",
"server:prof": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --require pprof --enable-source-maps dist/server.js",
"server:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/server.ts",
"job-runner": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/job-runner.js",
"job-runner:prof": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --require pprof --enable-source-maps dist/job-runner.js",
"job-runner:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/job-runner.ts",
Expand Down
5 changes: 0 additions & 5 deletions packages/uni-info-watcher/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,3 @@ main().then(() => {
process.on('uncaughtException', err => {
log('uncaughtException', err);
});

process.on('SIGINT', () => {
log(`Exiting process ${process.pid} with code 0`);
process.exit(0);
});
6 changes: 3 additions & 3 deletions packages/uni-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"test:init": "ts-node test/init.ts",
"test:chain-pruning": "mocha src/chain-pruning.test.ts",
"build": "tsc",
"server": "DEBUG=vulcanize:* node --enable-source-maps dist/server.js",
"server:prof": "DEBUG=vulcanize:* node --require pprof --enable-source-maps dist/server.js",
"server:dev": "DEBUG=vulcanize:* nodemon --watch src src/server.ts",
"server": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/server.js",
"server:prof": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --require pprof --enable-source-maps dist/server.js",
"server:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/server.ts",
"job-runner": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/job-runner.js",
"job-runner:prof": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --require pprof --enable-source-maps dist/job-runner.js",
"job-runner:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/job-runner.ts",
Expand Down
5 changes: 0 additions & 5 deletions packages/uni-watcher/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ main().then(() => {
process.on('uncaughtException', err => {
log('uncaughtException', err);
});

process.on('SIGINT', () => {
log(`Exiting process ${process.pid} with code 0`);
process.exit(0);
});

0 comments on commit 302be34

Please sign in to comment.