Skip to content

Commit

Permalink
add command to run the poller
Browse files Browse the repository at this point in the history
  • Loading branch information
yushih committed Jan 17, 2022
1 parent 25e1581 commit 4cc65a8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -7,6 +7,7 @@
"postinstall": "tsc",
"start": "pm2 start pm2.yaml",
"stop": "pm2 stop pm2.yaml",
"start-poller": "pm2 start ./dist/coin-price/poller.js --cron '* * * * *'",
"dev": "tsc-watch --onSuccess \"node ./dist/index.js\"",
"eslint": "eslint src tests",
"test": "mocha -r ts-node/register tests/**/*.test.ts --slow 0",
Expand Down
9 changes: 7 additions & 2 deletions src/coin-price/poller.ts
Expand Up @@ -149,7 +149,12 @@ export async function start() {
}
);

client.end();
await client.end();
}

start();
try {
start();
} catch(error) {
logger.error('poller error', error);
process.exit(1);
}
2 changes: 1 addition & 1 deletion tsconfig.json
Expand Up @@ -67,5 +67,5 @@
"skipLibCheck": true, /* Skip type checking of declaration files. */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"files": [ "./src/index.ts" ]
"files": [ "./src/index.ts", "./src/coin-price/poller.ts" ]
}

0 comments on commit 4cc65a8

Please sign in to comment.