зеркало из https://github.com/microsoft/etcd3.git
fix: Add return to leaking promises
This commit is contained in:
Родитель
5b72261859
Коммит
b4fbd29ee6
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче