mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 14:24:24 +00:00
Merge pull request #237 from nogueian/develop
Fixed issue with logic to detect if IPFS node is online
This commit is contained in:
commit
02cb5b7f1f
@ -70,18 +70,23 @@ ServicesMonitor.prototype.check = function() {
|
||||
body += d;
|
||||
});
|
||||
res.on('end', function() {
|
||||
var parsed = JSON.parse(body);
|
||||
if(parsed.Version){
|
||||
result.push(("IPFS " + parsed.Version).green);
|
||||
try{
|
||||
var parsed = JSON.parse(body);
|
||||
if(parsed.Version){
|
||||
result.push(("IPFS " + parsed.Version).green);
|
||||
}
|
||||
else{
|
||||
result.push("IPFS".green);
|
||||
}
|
||||
}
|
||||
else{
|
||||
result.push("IPFS".green);
|
||||
catch (e){
|
||||
result.push("IPFS".red);
|
||||
}
|
||||
callback(null, result);
|
||||
});
|
||||
res.on('error', function(err) {
|
||||
self.logger.trace("Check IPFS version error: " + err);
|
||||
result.push("IPFS".green);
|
||||
result.push("IPFS".red);
|
||||
callback(null, result);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user