Skip to content
Snippets Groups Projects
Commit d5ea0688 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Missing file

parent dfaed99e
No related branches found
No related tags found
No related merge requests found
...@@ -704,7 +704,10 @@ function BlockchainService (conf, mainDAL, pair) { ...@@ -704,7 +704,10 @@ function BlockchainService (conf, mainDAL, pair) {
} }
nextOne(); nextOne();
} }
], callback); ], (err) => {
logger.warn(err);
callback();
});
}, next); }, next);
} }
], function(err) { ], function(err) {
...@@ -790,6 +793,9 @@ function BlockchainService (conf, mainDAL, pair) { ...@@ -790,6 +793,9 @@ function BlockchainService (conf, mainDAL, pair) {
var gValidator = globalValidator(conf, blockchainDao(null, that.currentDal)); var gValidator = globalValidator(conf, blockchainDao(null, that.currentDal));
var identity = yield dal.getIdentityByHashOrNull(idHash); var identity = yield dal.getIdentityByHashOrNull(idHash);
var foundCerts = []; var foundCerts = [];
if (!identity) {
throw 'Identity with hash \'' + idHash + '\' not found';
}
if (!identity.leaving) { if (!identity.leaving) {
if (!current) { if (!current) {
// Look for certifications from initial joiners // Look for certifications from initial joiners
...@@ -1377,6 +1383,24 @@ function BlockchainService (conf, mainDAL, pair) { ...@@ -1377,6 +1383,24 @@ function BlockchainService (conf, mainDAL, pair) {
} }
return mainContext.dal.getBlocksBetween(from, from + count - 1); return mainContext.dal.getBlocksBetween(from, from + count - 1);
}); });
var cleanMemFifo = async.queue((task, callback) => task(callback), 1);
var cleanMemFifoInterval = null;
this.regularCleanMemory = function (done) {
if (cleanMemFifoInterval)
clearInterval(cleanMemFifoInterval);
cleanMemFifoInterval = setInterval(() => cleanMemFifo.push(cleanMemory), 1000 * constants.MEMORY_CLEAN_INTERVAL);
cleanMemory(done);
};
function cleanMemory(done) {
mainDAL.blockDAL.migrateOldBlocks()
.then(() => done())
.catch((err) => {
logger.warn(err);
done();
});
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment