mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 09:39:17 +01:00
backend: Read mtgox-weekly.json
from dist
This commit is contained in:
parent
8f0fc3af57
commit
5683f639ed
2 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,7 @@
|
|||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"tsc": "./node_modules/typescript/bin/tsc -p tsconfig.build.json",
|
||||
"build": "npm run tsc",
|
||||
"build": "npm run tsc && cp ./src/tasks/price-feeds/mtgox-weekly.json ./dist/tasks/",
|
||||
"start": "node --max-old-space-size=2048 dist/index.js",
|
||||
"start-production": "node --max-old-space-size=4096 dist/index.js",
|
||||
"test": "./node_modules/.bin/jest --coverage",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import * as fs from 'fs';
|
||||
import path from "path";
|
||||
import { Common } from '../api/common';
|
||||
import config from '../config';
|
||||
import logger from '../logger';
|
||||
|
@ -159,7 +160,7 @@ class PriceUpdater {
|
|||
const existingPriceTimes = await PricesRepository.$getPricesTimes();
|
||||
|
||||
// Insert MtGox weekly prices
|
||||
const pricesJson: any[] = JSON.parse(fs.readFileSync('./src/tasks/price-feeds/mtgox-weekly.json').toString());
|
||||
const pricesJson: any[] = JSON.parse(fs.readFileSync(path.join(__dirname, 'mtgox-weekly.json')).toString());
|
||||
const prices = this.getEmptyPricesObj();
|
||||
let insertedCount: number = 0;
|
||||
for (const price of pricesJson) {
|
||||
|
|
Loading…
Add table
Reference in a new issue