fix: Add return to leaking promises

This commit is contained in:
Anton Sidelnikov 2019-05-13 13:47:50 +07:00 коммит произвёл Connor Peet
Родитель 5b72261859
Коммит b4fbd29ee6
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -308,14 +308,14 @@ export class Lease extends EventEmitter {
});
this.emit('keepaliveEstablished');
this.fireKeepAlive(stream);
return this.fireKeepAlive(stream);
})
.catch(err => this.handleKeepaliveError(err));
}
private fireKeepAlive(stream: RPC.IRequestStream<RPC.ILeaseKeepAliveRequest>) {
this.emit('keepaliveFired');
this.grant()
return this.grant()
.then(id => stream.write({ ID: id }))
.catch(() => this.close()); // will only throw if the initial grant failed
}