Revamping configuration file.

fixes #141
This commit is contained in:
softsimon
2020-10-19 11:57:02 +07:00
parent 0abe62128e
commit 45efb604c1
17 changed files with 218 additions and 146 deletions

View File

@@ -1,4 +1,4 @@
const config = require('../../mempool-config.json');
import config from '../config';
import * as fs from 'fs';
import * as process from 'process';
import memPool from './mempool';
@@ -9,7 +9,7 @@ class DiskCache {
static FILE_NAME = './cache.json';
constructor() {
if (process.env.workerId === '0' || !config.CLUSTER_NUM_CORES || config.CLUSTER_NUM_CORES === 1) {
if (process.env.workerId === '0' || !config.MEMPOOL.SPAWN_CLUSTER_PROCS) {
process.on('SIGINT', () => {
this.saveCacheToDisk();
process.exit(2);