remove babel async to generator transform

This commit is contained in:
Roman Shtylman
2017-12-10 10:14:59 -08:00
parent db5b632a9f
commit 6318db6075
4 changed files with 18 additions and 47 deletions

View File

@@ -166,10 +166,7 @@ Proxy.prototype.next_socket = function(handler) {
self.debug('processing request');
handler(sock)
.catch((err) => {
log.error(err);
})
.finally(() => {
.then(() => {
if (!sock.destroyed) {
self.debug('retuning socket');
self.sockets.push(sock);
@@ -181,7 +178,22 @@ Proxy.prototype.next_socket = function(handler) {
}
self._process_waiting();
});
})
.catch((err) => {
log.error(err);
if (!sock.destroyed) {
self.debug('retuning socket');
self.sockets.push(sock);
}
// no sockets left to process waiting requests
if (self.sockets.length === 0) {
return;
}
self._process_waiting();
})
};
Proxy.prototype._done = function() {