backend: Read mtgox-weekly.json from dist
				
					
				
			This commit is contained in:
		
							parent
							
								
									6d6e7ce108
								
							
						
					
					
						commit
						a4d54dec47
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user