check ipfs connection before attempting to connect
This commit is contained in:
parent
17640e51de
commit
1564a2c511
|
@ -52,6 +52,7 @@ class IPFS {
|
||||||
}
|
}
|
||||||
|
|
||||||
setServiceCheck() {
|
setServiceCheck() {
|
||||||
|
console.dir("setServiceCheck");
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
self.events.on('check:backOnline:IPFS', function () {
|
self.events.on('check:backOnline:IPFS', function () {
|
||||||
|
@ -65,14 +66,14 @@ class IPFS {
|
||||||
self.events.request("services:register", 'IPFS', function (cb) {
|
self.events.request("services:register", 'IPFS', function (cb) {
|
||||||
self._checkService((err, body) => {
|
self._checkService((err, body) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
self.logger.trace("IPFS unavailable");
|
self.logger.info("IPFS unavailable");
|
||||||
return cb({name: "IPFS ", status: 'off'});
|
return cb({name: "IPFS ", status: 'off'});
|
||||||
}
|
}
|
||||||
if (body.Version) {
|
if (body.Version) {
|
||||||
self.logger.trace("IPFS available");
|
self.logger.info("IPFS available");
|
||||||
return cb({name: ("IPFS " + body.Version), status: 'on'});
|
return cb({name: ("IPFS " + body.Version), status: 'on'});
|
||||||
}
|
}
|
||||||
self.logger.trace("IPFS available");
|
self.logger.info("IPFS available");
|
||||||
return cb({name: "IPFS ", status: 'on'});
|
return cb({name: "IPFS ", status: 'on'});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue