diff --git a/external/libp2p-service.js b/external/libp2p-service.js index d3f0c4173..10b57b9c2 100644 --- a/external/libp2p-service.js +++ b/external/libp2p-service.js @@ -165,19 +165,16 @@ class Libp2pService { this.node.handle(eventName, async (handlerProps) => { const {stream} = handlerProps; let timestamp = Date.now(); - this.limiter.limit(handlerProps.connection.remotePeer.toB58String()).then(async (blocked) => { - if (blocked) { - const preparedBlockedResponse = await this.prepareForSending(constants.NETWORK_RESPONSES.BLOCKED); - await pipe( - [preparedBlockedResponse], - stream - ); - requestBlocked = true; - this.logger.info(`Blocking request from ${handlerProps.connection.remotePeer._idB58String}. Max number of requests exceeded.`); - return; - } - } - ); + const blocked = await this.limiter.limit(handlerProps.connection.remotePeer.toB58String()); + if(blocked) { + const preparedBlockedResponse = await this.prepareForSending(constants.NETWORK_RESPONSES.BLOCKED); + await pipe( + [preparedBlockedResponse], + stream + ); + this.logger.info(`Blocking request from ${handlerProps.connection.remotePeer._idB58String}. Max number of requests exceeded.`); + return; + } let data = await pipe( stream, async function (source) { diff --git a/modules/service/data-service.js b/modules/service/data-service.js index ae6b9273e..bab91e448 100644 --- a/modules/service/data-service.js +++ b/modules/service/data-service.js @@ -709,7 +709,7 @@ class DataService { this.logger.info('TripleStore is busy.'); } if (isToobusy) { - this.logger.info('TripleStore is busy.'); + this.logger.info('Node is busy.'); } return isToobusy || isTripleStoreBusy; }