Skip to content

Commit

Permalink
Merge pull request #36 from FinBook/retry
Browse files Browse the repository at this point in the history
add retry to feed and fetch
  • Loading branch information
yizhoucao committed Mar 12, 2019
2 parents 34987d1 + 787ed6a commit 9470329
Show file tree
Hide file tree
Showing 17 changed files with 815 additions and 125 deletions.
6 changes: 3 additions & 3 deletions bash/aws.sh
@@ -1,8 +1,8 @@
killall -s KILL node
rm *.log
npm run trades assets=ETH,USD server aws &> trades.ALL.log &
npm run commit server aws pair=ETH_USD &>> commit.log &
npm run commit server aws pairs=ETH_USD &>> commit.log &
npm run cleanDB server aws &>> cleanDB.log &
npm run round contractType=Vivaldi tenor=100C-3H debug server aws &>> vivaldi-100C-3H.log &
npm run fetchPrice server aws &>> fetchPrice.log &
npm run round contractType=Vivaldi tenor=100C-1H debug server aws &>> vivaldi-100C-1H.log &
npm run fetchPrice server pairs=ETH_USD aws &>> fetchPrice.log &
npm run events server aws events=StartReset,StartPreReset $1 &>> events.log &
6 changes: 3 additions & 3 deletions bash/azure.sh
@@ -1,8 +1,8 @@
killall -s KILL node
rm *.log
npm run trades assets=ETH,USD server azure &> trades.ALL.log &
npm run commit server azure pair=ETH_USD &>> commit.log &
npm run commit server azure pairs=ETH_USD &>> commit.log &
npm run cleanDB server azure &>> cleanDB.log &
npm run round contractType=Vivaldi tenor=100C-3H debug server azure &>> vivaldi-100C-3H.log &
npm run fetchPrice server azure &>> fetchPrice.log &
npm run round contractType=Vivaldi tenor=100C-1H debug server azure &>> vivaldi-100C-1H.log &
npm run fetchPrice server pairs=ETH_USD azure &>> fetchPrice.log &
npm run events server azure events=StartReset,StartPreReset $1 &>> events.log &
6 changes: 3 additions & 3 deletions bash/gcp.sh
@@ -1,8 +1,8 @@
killall -s KILL node
rm *.log
npm run trades assets=ETH,USD server gcp &> trades.ALL.log &
npm run commit server gcp pair=ETH_USD &>> commit.log &
npm run commit server gcp pairs=ETH_USD &>> commit.log &
npm run cleanDB server gcp &>> cleanDB.log &
npm run round contractType=Vivaldi tenor=100C-3H debug server gcp &>> vivaldi-100C-3H.log &
npm run fetchPrice server gcp &>> fetchPrice.log &
npm run round contractType=Vivaldi tenor=100C-1H debug server gcp &>> vivaldi-100C-1H.log &
npm run fetchPrice server pairs=ETH_USD gcp &>> fetchPrice.log &
npm run events server gcp events=StartReset,StartPreReset $1 &>> events.log &
4 changes: 2 additions & 2 deletions bashLive/aws.sh
Expand Up @@ -2,6 +2,6 @@ killall -s KILL node
rm *.log
npm run trades assets=ETH,USD server aws live &> trades.ALL.log &
npm run cleanDB server aws live &>> cleanDB.log &
npm run commit server aws live pair=ETH_USD &>> commit.log &
npm run fetchPrice server aws live &>> fetchPrice.log &
npm run commit server aws live pairs=ETH_USD &>> commit.log &
npm run fetchPrice server pairs=ETH_USD aws live &>> fetchPrice.log &
npm run events server aws live events=StartReset,StartPreReset $1 &>> events.log &
4 changes: 2 additions & 2 deletions bashLive/azure.sh
Expand Up @@ -2,6 +2,6 @@ killall -s KILL node
rm *.log
npm run trades assets=ETH,USD server azure live &> trades.ALL.log &
npm run cleanDB server azure live &>> cleanDB.log &
npm run commit server azure live pair=ETH_USD &>> commit.log &
npm run fetchPrice server azure live &>> fetchPrice.log &
npm run commit server azure live pairs=ETH_USD &>> commit.log &
npm run fetchPrice server pairs=ETH_USD azure live &>> fetchPrice.log &
npm run events server azure live events=StartReset,StartPreReset $1 &>> events.log &
4 changes: 2 additions & 2 deletions bashLive/gcp.sh
Expand Up @@ -2,6 +2,6 @@ killall -s KILL node
rm *.log
npm run trades assets=ETH,USD server gcp live &> trades.ALL.log &
npm run cleanDB server gcp live &>> cleanDB.log &
npm run commit server gcp live pair=ETH_USD &>> commit.log &
npm run fetchPrice server gcp live &>> fetchPrice.log &
npm run commit server gcp live pairs=ETH_USD &>> commit.log &
npm run fetchPrice server pairs=ETH_USD gcp live &>> fetchPrice.log &
npm run events server gcp live events=StartReset,StartPreReset $1 &>> events.log &
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -49,7 +49,7 @@
},
"dependencies": {
"@babel/polyfill": "^7.2.5",
"@finbook/duo-contract-wrapper": "^1.3.4",
"@finbook/duo-contract-wrapper": "^1.3.6",
"@finbook/duo-market-data": "^1.0.4",
"@google-cloud/storage": "^2.4.1",
"aws-cli-js": "^2.0.4",
Expand Down
3 changes: 2 additions & 1 deletion src/common/types.ts
Expand Up @@ -14,6 +14,7 @@ export interface ISqlAuth {
export interface IOption {
forceREST: boolean;
pair: string;
pairs: string[];
sources: string[];
exSources: string[];
assets: string[];
Expand Down Expand Up @@ -143,7 +144,7 @@ export interface IGdaxRawTradeRest {
}

export interface ISubProcess {
source: string;
processName: string;
instance: ChildProcess;
lastFailTimestamp: number;
failCount: number;
Expand Down
12 changes: 6 additions & 6 deletions src/index.ts
Expand Up @@ -32,7 +32,7 @@ util.logInfo(
dbUtil.init(tool, option).then(() => {
switch (tool) {
case CST.TRADES:
new MarketDataService().startFetching(tool, option);
new MarketDataService().startFetchingTrade(tool, option);
break;
case CST.EVENTS:
new MarketDataService().startFetchingEvent(tool, option);
Expand All @@ -43,14 +43,14 @@ dbUtil.init(tool, option).then(() => {
case CST.CLEAN_DB:
new MarketDataService().cleanDb();
break;
case CST.START_CUSTODIAN:
new ContractService(tool, option).startCustodian(option);
break;
case CST.COMMIT:
new ContractService(tool, option).commitPrice();
new MarketDataService().startPriceFixService(tool, option);
break;
case CST.FETCH_PRICE:
new ContractService(tool, option).fetchPrice();
new MarketDataService().startPriceFixService(tool, option);
break;
case CST.START_CUSTODIAN:
new ContractService(tool, option).startCustodian(option);
break;
case CST.ROUND:
new ContractService(tool, option).round(option);
Expand Down

0 comments on commit 9470329

Please sign in to comment.