Browse Source

cache, fork bugfix

all-modes
pbca26 8 years ago
parent
commit
46f6f445af
  1. 1
      gui/loading.js
  2. 3
      main.js
  3. 12
      routes/cache.js
  4. 2
      routes/shepherd.js

1
gui/loading.js

@ -13,7 +13,6 @@ function IguanaAJAX(url, ajax_data, timeout) {
}
function Iguana_activehandle(appConf) {
$('#loading_status_text').text(appConf.iguanaCorePort);
return new Promise((resolve) => {
var ajax_data = {
'agent': 'SuperNET',

3
main.js

@ -357,7 +357,8 @@ function createWindow (status) {
if (appConfig.edexGuiOnly) {
if (appConfig.v2) {
shepherd.writeLog('show edex gui');
mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/EasyDEX-GUI/react/build');
mainWindow.loadURL('http://127.0.0.1:3000');
//mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/EasyDEX-GUI/react/build');
} else {
shepherd.writeLog('show edex gui');
mainWindow.loadURL('http://' + appConfig.host + ':' + appConfig.iguanaAppPort + '/gui/EasyDEX-GUI/');

12
routes/cache.js

@ -290,11 +290,13 @@ cache.one = function(req, res, next) {
if (!cacheCallInProgress) {
cache.dumpCacheBeforeExit();
let _data = fs.readFileSync(cache.iguanaDir + '/shepherd/cache-' + req.query.pubkey + '.json', 'utf8');
if (_data) {
inMemCache = JSON.parse(_data);
_data = _data.replace('waiting', 'failed');
cache.dumpCacheBeforeExit();
if (fs.existsSync(cache.iguanaDir + '/shepherd/cache-' + req.query.pubkey + '.json')) {
let _data = fs.readFileSync(cache.iguanaDir + '/shepherd/cache-' + req.query.pubkey + '.json', 'utf8');
if (_data) {
inMemCache = JSON.parse(_data);
_data = _data.replace('waiting', 'failed');
cache.dumpCacheBeforeExit();
}
}
// TODO: add check to allow only one cache call/sequence in progress

2
routes/shepherd.js

@ -537,7 +537,7 @@ shepherd.post('/forks', function(req, res, next) {
iguanaInstanceRegistry[_port] = {
'mode': mode,
'coin': coin,
'pid': apps[0].process.pid,
'pid': apps[0].process && apps[0].process.pid,
'pmid': apps[0].pm2_env.pm_id
};
cache.setVar('iguanaInstances', iguanaInstanceRegistry);

Loading…
Cancel
Save